Page 1 of 1

What is printed out? int arr[10] = { 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 }; int* p; p = arr; cout << *(p++) << ' '; co

Posted: Sun Jul 10, 2022 11:29 am
by answerhappygod
What is printed out?
int arr[10] = { 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 };
int* p; p = arr;
cout << *(p++) << ' ';
cout << *p << endl;
Also if:
int arr[10] = { 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 };
int* p; p = arr+5;
cout << p​[-1] << endl;