ProgrammingEasyTCS NQT · Infosys pattern

The end of a C string is marked by:

  1. A. The EOF macro
  2. B. A length stored in the first byte
  3. C. The null character '\0'
  4. D. The newline character '\n'

Correct answer: C. The null character '\0'

A C string is a char array terminated by '\0' (value 0). Library functions such as strlen and printf("%s") stop at that byte; C stores no length.

More C Programming questions

Exams that ask this topic