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
How can I read in an object file and jump to locations in it?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What is meant by type casting?
Can a program have two main functions?
Write a program to print fibonacci series without using recursion?
Tell me what is the purpose of 'register' keyword in c language?
How can I trap or ignore keyboard interrupts like control-c?
How can variables be characterized?
What are the uses of a pointer?
what are the different storage classes in c?
How do you define a string?
Explain About fork()?
What is c definition?
How are strings stored in c?