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; }

4th Feb 2021, 9:29 PM
Edward Finkelstein
Edward Finkelstein - avatar
2 Antworten
+ 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];
4th Feb 2021, 10:38 PM
perevertysh
perevertysh - avatar
+ 1
Thanks perevertysh
4th Feb 2021, 10:49 PM
Edward Finkelstein
Edward Finkelstein - avatar