I would really like some help regarding pointers in c++. Take a look at the following code:
int array[3]={4,7,2};
int * a;
a = array;
char Carray[3]={'p','k','\0'};
char * c;
c = Carray;
cout << a << "\n";
cout << c << "\n";
Printing a gives back the address of the first element of the array i.e 4 as expected.
But printing c should have given the address of the first element of Carray i.e p but instead it gives the whole string i.e 'pk' in this case. and we havent used a value operator * here.
It will be very kind if someone can explain this to me