Tracing a report name

A logging utility executes the following code with string.h included. Each displayed character occupies one byte. Find the final value of strlen(report) in bytes and the maximum number of additional non-null text bytes that could be appended while retaining a terminating null character. Give both answers as exact integers.


C
char report[20] = "unit";
strcat(report, "-west");
strcat(report, ".dat");
Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Strings and string.h Questions: