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
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
C language questions for civil engineering
What is difference between class and structure?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What is the purpose of macro in C language?
Can an array be an Ivalue?
what will be maximum number of comparisons when number of elements are given?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
i have a written test for microland please give me test pattern
What is action and transformation in spark?
Why can’t we compare structures?
What is getche() function?
What are the functions to open and close file in c language?
What is ## preprocessor operator in c?
What is structure in c language?