Top

Discussion

For the following code snippet:
char *str = “AllIndiaExams.in\0? “training classes”;
The character pointer str holds reference to string:

  • A.AllIndiaExams.in
  • B.AllIndiaExams.in training classes
  • C.AllIndiaExams.in\0training classes
  • D.Syntax error

Answer: C

’\0' is accepted as a char in the string. Even though strlen will give length of string “AllIndiaExams.in”, in memory str is pointing to entire string including training classes”

No comment is present. Be the first to comment.
Loading…

Post your comment