What is the output of this program?
1. #include2. using namespace std; 3. int main() 4. { 5. int i; 6. char *arr[] = {"C", "C++", "Java", "VBA"}; 7. char *(*ptr)[4] = &arr; 8. cout << ++(*ptr)[2]; 9. return 0; 10. }
Answer : Option A
Explanation :
In this program we are moving the pointer from first position to second position and printing the
remaining value.
Output:
$ g++ point1.cpp
$ a.out
ava