What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / ashish
here a is an array and is a char const * data type.
hence u cannot change value of a but u can change the value
which a points to.
p on the other hand is a const char * data type.
hence value of p an be changed but the value p points to
cannot be changed.
i dont know the answer!!! :P
| Is This Answer Correct ? | 3 Yes | 13 No |
Post New Answer View All Answers
What is masking?
What is meant by inheritance?
What is a method in c?
Why we use break in c?
What is the difference between abs() and fabs() functions?
What is a program flowchart and explain how does it help in writing a program?
What is meant by errors and debugging?
What are logical errors and how does it differ from syntax errors?
What is hashing in c?
What is structure and union in c?
Why c language is called c?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
What are structures and unions? State differencves between them.
Explain what standard functions are available to manipulate strings?
What is a good data structure to use for storing lines of text?