difference between array and pointer storage

char array_place[100] = "don't panic";
char* ptr_place = "don't panic";

here "don't panic" will be stored in the first memory location of the array array_place
how the pointer ptr_place store "don't panic"
pointer store the memory location of the variable it points to... her it points to string... plz tel me how it points to the string
It points to the first character of the string literal. The string literal is somewhere in the read-only data section of your program - so its storage is being handled automatically.
Note that string literals are constant arrays - hence you're not allowed to attempt to modify it using that pointer. You should use pointers to const char* when dealing with string literals.
thanq so much for reply!
where can i learn tese basic fundamentals..... plz tel me
you can refer books
http://www.cplusplus.com/articles/GLzyhbRD/
refer the links to get to know about diff type of c++ books according to ur knowledge
Last edited on
Topic archived. No new replies allowed.