Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. For the following code snippet:
    char *str = "AllIndiaExams.in\0? "training classes;
    The character pointer str holds reference to string:
  2. A.
    AllIndiaExams.in
    B.
    AllIndiaExams.in training classes
    C.
    AllIndiaExams.in\0training classes
    D.
    Syntax error

    View Answer

    Workspace

    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