I am trying to do following:
char c[] = "programming";
char *p;
*(c-1)='l';
*(c-2)='l';
*(c-3)='l';
*(c-4)='l';
*(c-5)='l';
p=&c[0];
cout<<*(c-1);
This prints l
only if I omit p=&c[0];
why is that so? There is no relation apparently between p
and c
.