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 are the various types of control structures in programming?
How do you convert strings to numbers in C?
code for quick sort?
Difference between constant pointer and pointer to a constant.
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
What are the features of c language?
Differentiate between static and dynamic modeling.
Can you assign a different address to an array tag?
Can 'this' pointer by used in the constructor?
write a proram to reverse the string using switch case?
How would you obtain the current time and difference between two times?
What is a buffer in c?
What does #pragma once mean?
What are the types of data files?
What are the characteristics of arrays in c?