0
Output of C++ code
Can someone explain this C++ code? #include <iostream> using namespace std; int main() { char *arr[]={"c","c++","java","vba"}; char *(*ptr)[4] = &arr; cout << (*ptr)[2]; return 0; }
2 Answers
+ 2
// created array of char strings
char *arr[]={"c","c++","java","vba"};
// made array of pointers to first one
char *(*ptr)[4] = &arr;
// console out of third element of array ("java")
cout << (*ptr)[2];
+ 1
Thanks perevertysh