Hi,
I have a very basic problem related to strings using pointers in c++
//////////////////
i wrote code as,
int *i_ptr;
char *c_ptr;
int i=5;char c='A';
i_ptr=&i;
c_ptr=&c;
cout<<i_ptr;
cout<<c_ptr;
As an o/p i get an address of i_ptr but c_ptr doesn't store any addr WHY?
How sting are stored in memory(1 dim &2dim both) &how pointers access them?
As when we write a[1] we get addr if a is an array of pointers but in case of strings it returns string n not the address ,how?
I have a very basic problem related to strings using pointers in c++
//////////////////
i wrote code as,
int *i_ptr;
char *c_ptr;
int i=5;char c='A';
i_ptr=&i;
c_ptr=&c;
cout<<i_ptr;
cout<<c_ptr;
As an o/p i get an address of i_ptr but c_ptr doesn't store any addr WHY?
How sting are stored in memory(1 dim &2dim both) &how pointers access them?
As when we write a[1] we get addr if a is an array of pointers but in case of strings it returns string n not the address ,how?
Comment