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
Which driver is a pure java driver
How can I discover how many arguments a function was actually called with?
What is c language used for?
How many levels of indirection in pointers can you have in a single declaration?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
Why do we need volatile in c?
What is #include cctype?
Can we declare function inside main?
Can we replace the struct function in tree syntax with a union?
What are the applications of c language?
What do you understand by friend-functions? How are they used?
Write a program of prime number using recursion.
How can I determine whether a machines byte order is big-endian or little-endian?
explain what is a newline escape sequence?
while initialization of array why we use a[][2] why not a[2][]...?