Comment on the output of this C++ code? #include struct temp { int a; int b; int c; }; int main() { struct temp p[] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; return 0; } 1. No Compile time error, generates an array of structure of size 3 2. No Compile time error, generates an array of structure of size 9 3. Compile time error, illegal declaration of a multidimensional array 4. Compile time error, illegal assignment to members of structure
When this program is executed, nothing is display on the screen. This is because, cout, which causes output on the screen , has not been used
Comments
Leave a comment