Home » C Programming » Constants » Question
  1. In the following code snippet, character pointer str holds a reference to the string ___________.
    char *s =  "interviewmania.com\0" "c programming";
    1. interviewmania.comc programming
    2. interviewmania.com
    3. c programming\0c programming
    4. c programming
    5. None of these
Correct Option: C

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



Your comments will be displayed only after manual approval.