what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?

Answer Posted / vignesh1988i

surely there is some difference.....

here 'a' is represented as array in which string gets stored
in consecutive locations......

p is a pointer variable where string is initilized... so in
p the base address of "literal " will get stored......

*p++ increments 'p' , but pertaining to some conditions.....
++ has more precedence than * , so first it will increment
the address and correspondingly it will show the value as *
precedes..... so after the increment the p points to 'i'...



thank u

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the scope of static variable in c?

747


why return type of main is not necessary in linux

1905


How can I do serial ("comm") port I/O?

944


Write a code to generate divisors of an integer?

845


What are the advantage of c language?

797


Should I learn c before c++?

1001


Explain high-order bytes.

912


What is far pointer in c?

1030


What are the main characteristics of c language describe the structure of ac program?

968


Describe newline escape sequence with a sample program?

908


What does a pointer variable always consist of?

888


What is fflush() function?

906


int i=10; printf("%d %d %d", i, i=20, i);

1335


Why is structure important for a child?

855


What is the difference between procedural and declarative language?

923