The character pointer str holds reference to string:
A. Sanfoundry.com
B. Sanfoundry.com\0training classes
C. Sanfoundry.comtraining classes
D. Invalid declaration
Answer:A
The character pointer str holds reference to string:
A. Sanfoundry.com B. Sanfoundry.com\0training classes C. Sanfoundry.comtraining classes D. Invalid declaration
Explanation:’\0′ is accepted as a char in the string. Even though strlen will give length of string “Sanfoundry.com”, in memory str is pointing to entire string including training classes”