Home » C++ Programming » Pointers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    char *p;
    char S[] = "interviewMania";
    p = S;
    p += 5;
    cout << p;
    return 0;
    }

    1. InterviewMania
    2. Mania
    3. Interview
    4. viewMania
    5. None of these
Correct Option: D

Pointer p points to string ‘viewMania ’. So it prints viewMania .



Your comments will be displayed only after manual approval.