Is possible to assign pointer to array or array to array?
int arr[3] {1,2,3};
int pnt[3];
pnt = arr;
//or
pnt = &arr[0];
compiler don't want accept this....
assign pointer to array
You can assign array to a pointer. E.g.:
int b[2] = {3,4};
int *p;
p=b;
Note, that in your case, you've tried to assign an array to another array, not a pointer. The variable p is still a pointer, but now happens to point to the place in memory, where the array b sits.
or array to array
No, you can't do this. You could use std::array if you want this kind of syntax. In case of the raw array, like in the example, you'd have to copy the data from one array to another.
pntis an array, not a pointer, and arrays can't be assigned to.arrin the right context will be equivalent to&arr[0], and that will have the type "pointer toint", orint *. But even with the decay, an array isn't a pointer.int pnt[3];toint* pnt;then both statementspnt = arr;andpnt = &arr[0];will work.pnt = arrwould work if they werestd::vector<int>.