Array of pointers

Could someone explain what does line 7 mean.Why it gives error when braces is not used.Also why & sign is used with a2rr?And some thing about line 8.

1
2
3
4
5
6
7
8
9
10
#include <iostream>
using namespace std;
int main()
{
	int i;
	char *a2rr[]={"c","c++","java","verilog"};
	char *(*ptr)[4]=&a2rr;
	cout << ++(*ptr)[3];
	return 0;
}
line 7 is creating a pointer to the a2rr.
the *(*ptr)[4] shall be read as a pointer to an array with 4 pointers called ptr.
and &a2rr is just taking the address of a2rr
Topic archived. No new replies allowed.