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 advantages of c language?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
Explain how can you tell whether a program was compiled using c versus c++?
How is a structure member accessed?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
What is difference between main and void main?
Where can I get an ansi-compatible lint?
What is union and structure in c?
What is a char in c?
Explain how do you declare an array that will hold more than 64kb of data?
How do you print an address?
Where local variables are stored in c?
How do you override a defined macro?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Which type of language is c?