I want to assign address of string to some pointer,
following are tow cases, which one is safe? and why?
case one:
char *p = "running";
case two:
char temp[] = "running";
char *p=temp;
I have a question related to your code.
In case 2 u hav assigned addr of temp to ptr.But when we print it,we don't et addr
if temp is a char var char temp='a';
then aalso on assigning addr of temp to p & printing p's valuse on screen we don't get addr How's that?Pls help me I am very confused
if names[]={ "asd","wer","qwe"}
here also
char *p;
p=names[0];
it assigns addr to p & if we print names[0] we get 1st string itself .How????