Home » C++ Programming » Arrays » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int k;
    char *array[] = {"Red", "Blue", "Green", "Yellow"};
    char *(*p)[4] = &array;
    cout << ++(*p)[2];
    return 0;
    }
    1. Red
    2. Blue
    3. Green
    4. Yellow
    5. reen
Correct Option: E

In this program we are moving the pointer from first position to second position and printing the remaining value.



Your comments will be displayed only after manual approval.