What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / karuna
a[] is a constant pointer to a string;
char *p is a pointer to a constant string;
In a[] address of a[] cant be change but string can be
change.
In char *p address can be change string cant be change
Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
What is structure padding in c?
Why doesnt this code work?
Can you please explain the difference between malloc() and calloc() function?
Is file a keyword in c?
How to establish connection with oracle database software from c language?
What's a good way to check for "close enough" floating-point equality?
what does static variable mean?
Is null valid for pointers to functions?
Explain about block scope in c?
What is a void * in c?
What is a function in c?
Is it possible to have a function as a parameter in another function?
How variables are declared in c?
What is #include conio h?