What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / ashok
Pointers are fine a cannot be changed p can be changed.
I have a doubt like is there any difference in memory
allocation.
I heard like a gets its memory in local stack and p gets in
data section.
I don get the clear explanation
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
List the difference between a 'copy constructor' and a 'assignment operator' in C?
Why cant I open a file by its explicit path?
What is volatile, register definition in C
Can an array be an Ivalue?
Why we use conio h in c?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
What is d'n in c?
What are the advantages of Macro over function?
What is return in c programming?
What is the difference between printf and scanf in c?
What is the maximum length of an identifier?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
Where define directive used?
What is the function of volatile in c language?