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
What is the scope of static variable in c?
why return type of main is not necessary in linux
How can I do serial ("comm") port I/O?
Write a code to generate divisors of an integer?
What are the advantage of c language?
Should I learn c before c++?
Explain high-order bytes.
What is far pointer in c?
What are the main characteristics of c language describe the structure of ac program?
Describe newline escape sequence with a sample program?
What does a pointer variable always consist of?
What is fflush() function?
int i=10; printf("%d %d %d", i, i=20, i);
Why is structure important for a child?
What is the difference between procedural and declarative language?