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
Can 'this' pointer by used in the constructor?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
Explain is it better to bitshift a value than to multiply by 2?
Why is it important to memset a variable, immediately after allocating memory to it ?
What do you mean by keywords in c?
What extern c means?
What is the general form of #line preprocessor?
What is the most efficient way to count the number of bits which are set in an integer?
How can I read a binary data file properly?
How can I swap two values without using a temporary?
Explain the use of bit fieild.
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What does %p mean?
Why structure is used in c?