I have some questions about char-pointers in c++. I have made a image <img src="
of what i THINK is happening when i write
char c[] = "hello";
char* c2= c;
and
char c = "hello";
char* c2= c;
Is this image correct? How can adress of "c" be the same as c[0] and c in the first image?
And why is "c2" pointing to "c[0]" and not to "c" in the last image?
of what i THINK is happening when i write
char c[] = "hello";
char* c2= c;
and
char c = "hello";
char* c2= c;
Is this image correct? How can adress of "c" be the same as c[0] and c in the first image?
And why is "c2" pointing to "c[0]" and not to "c" in the last image?