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
Can we use visual studio for c?
Difference between Shallow copy and Deep copy?
What are predefined functions in c?
What are the storage classes in C?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
Do pointers need to be initialized?
Write a program to swap two numbers without using third variable?
Can the sizeof operator be used to tell the size of an array passed to a function?
Explain null pointer.
What are preprocessor directives in c?
What do you mean by a sequential access file?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is a null pointer in c?