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
Explain what is the difference between far and near ?
what is uses of .net
Why is structure padding done in c?
Is anything faster than c?
What is the purpose of clrscr () printf () and getch ()?
how can I convert a string to a number?
Why is sprintf unsafe?
Can a pointer be null?
What is difference between Structure and Unions?
Explain that why C is procedural?
Can math operations be performed on a void pointer?
What is exit() function?
Why can’t we compare structures?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
What is nested structure with example?