0

Output of C++ code

Can someone explain how this code works? Also, why does it issue a warning in the C compiler but not the C++ compiler? #include <iostream> using namespace std; int main() { int a[][3]={1,2,3,4,5,6}; int (*ptr)[3] = a; printf("%d %d ", (*ptr)[1], (*ptr)[2]); ++ptr; printf("%d %d",(*ptr)[1], (*ptr)[2]); return 0; } https://code.sololearn.com/cIp2L0q5kGua/#cpp

23rd Jul 2020, 6:40 PM
Edward Finkelstein
Edward Finkelstein - avatar
1 Antwort
0
Here u uses iostream header file which belongs to c++
23rd Jul 2020, 6:45 PM
Sâgærāvürï
Sâgærāvürï - avatar