Discussion :: C-MCQs
-
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 : Option C
Explanation :
'\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
Be The First To Comment

Whatsapp
Facebook