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
Why c is called a mid level programming language?
What is the easiest sorting method to use?
What is the value of uninitialized variable in c?
What are the advantages of using macro in c language?
how we can make 3d venturing graphics on outer interface
What does *p++ do?
Are enumerations really portable?
Does sprintf put null character?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
to find the closest pair
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
What is hash table in c?
What is the advantage of an array over individual variables?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(