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
When should a type cast not be used?
c language interview questions & answer
Write a program to swap two numbers without using third variable in c?
Is c is a middle level language?
Explain the bubble sort algorithm.
What is a pointer in c?
What is ponter?
Write a program to print factorial of given number without using recursion?
What are types of functions?
can we have joblib in a proc ?
Explain what are global variables and explain how do you declare them?
application attempts to perform an operation?
Can a variable be both const and volatile?
How can type-insensitive macros be created?
When should structures be passed by values or by references?