I have a doubt regarding pointers to array. the following program gives a compilation error if while declaring the pointer i give 'int (* ptr)[3] = arr;' instead of '=&arr'. Why is it so? I am using MS visual studio for compiling the program.


#include<iostream>
using namespace std;


int arr[3] = {1,2,3};


int main()
{

int (* ptr)[3] = &arr;

cout<<"The value of arrays "<<arr[0] <<" "<<arr[1] <<" ";

getchar();

return 0;

}