What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / ashwin kumar
just one word i can say that
a[] is static memory allocation ( we cant increase size of
array while execution of program )
*p is a dynamic memory allocation ( where we can use
according to our requirement while execution )
their may be a waste age of memory and also their may be
limitaion of elements in array.
memory will not be wasted and size depends up on our
require ment in pointes
i hope its may be one of the defferance
if thier is any feed back or my answer is wrong plz write
to molugu.aswin@gmail.com
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What is difference between function overloading and operator overloading?
What are two dimensional arrays alternatively called as?
Place the #include statement must be written in the program?
What are the storage classes in C?
What is meant by initialization and how we initialize a variable?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What are the basic data types associated with c?
What is the difference between declaring a variable and defining a variable?
How can you return multiple values from a function?
What is #include stdio h and #include conio h?
What is structure in c definition?
What are the advantages of the functions?
Explain what are run-time errors?
What is .obj file in c?
What is realloc in c?