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 are the 4 types of unions?
Explain why C language is procedural?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
When is a null pointer used?
What is the difference between array and pointer in c?
Are c and c++ the same?
How can I access an I o board directly?
What is the function of this pointer?
What does a pointer variable always consist of?
What is the difference between memcpy and memmove?
Define the scope of static variables.
What are conditional operators in C?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
What does %p mean c?