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
Can a local variable be volatile in c?
What is sizeof int?
How is a pointer variable declared?
What is character constants?
Write a program to reverse a given number in c?
What is call by reference in functions?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
what do you mean by inline function in C?
What is extern storage class in c?
What is a structure and why it is used?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
There seem to be a few missing operators ..
What is a good way to implement complex numbers in c?
What is a const pointer?
Explain how does flowchart help in writing a program?