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 the best organizational structure?
Explain bitwise shift operators?
what are bit fields in c?
Define and explain about ! Operator?
What is register variable in c language?
In which language linux is written?
What is %d called in c?
How can I copy just a portion of a string?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What are header files? What are their uses?
Explain a file operation in C with an example.
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
Why does everyone say not to use scanf? What should I use instead?
Was 2000 a leap year?
What is difference between scanf and gets?