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
Differentiate between ordinary variable and pointer in c.
Why is main function so important?
What is a function simple definition?
how do you programme Carrier Sense Multiple Access
What does the && operator do in a program code?
What is #define?
What is printf () in c?
Explain about C function prototype?
How can variables be characterized?
What are local static variables? How can you use them?
What are the different types of control structures?
What is the use of getch ()?
What are control structures? What are the different types?
Should I learn c before c++?
What is typedf?