+ 1
Output of C++ code
Hello, Can someone explain the syntax of this code and what it does? #include <iostream> using namespace std; int main() { int mat[2][2] = {{1,2},{3,5}}; cout << 0[1[mat]]; return 0; }
4 Respuestas
+ 1
This is a two dimensional array and the code will print the first item from the second element.
cout<<mat[1[0]];
+ 1
HBhZ_C
we could see that by running code...
but why 0[1[mat]] == mat[1[0]] ?
+ 1
Not equal but the right side of assignments is the used syntax in other languages .print the first(index 0) item from the second element or row ==>3 visph
+ 1
not equals?
but output same value ^^