what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?
Answer Posted / gaurav
I am totally satisfied with your above explanation except
last one.
i.e. Char *p="literal";
So, i want to mention yes this will work.
Explanation: *p++.
Here we have post increment.
Postfix increment/decrement have high precedence, but the
actual increment or decrement of the operand is delayed (to
be accomplished sometime before the statement completes
execution).
value of printf("\nstr=%c\n",*p++) will be 'l', but before
complete execution of this statement p will point to string
"iteral" as p got incremented.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is the difference between a free-standing and a hosted environment?
Write a code to generate divisors of an integer?
How do c compilers work?
Tell me is null always defined as 0(zero)?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
what are bit fields in c?
What is a structure and why it is used?
Why header files are used?
What does main () mean in c?
What is sorting in c plus plus?
What is the use of parallelize in spark?
What is restrict keyword in c?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
What is scanf_s in c?
What are the different properties of variable number of arguments?