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 syallabus of computer science students in group- 1?
Write a program to reverse a given number in c language?
Discuss the function of conditional operator, size of operator and comma operator with examples.
What are register variables? What are the advantage of using register variables?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
How do I get an accurate error status return from system on ms-dos?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What does stand for?
please send me the code for multiplying sparse matrix using c
Is null always defined as 0(zero)?
What is floating point constants?
Describe the steps to insert data into a singly linked list.
What is masking?
What does static variable mean in c?