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
Differentiate between a for loop and a while loop? What are it uses?
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
Where can I get an ansi-compatible lint?
Are pointers integers in c?
Why can’t we compare structures?
What happens if a header file is included twice?
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
Which is better pointer or array?
What is getche() function?
How do I determine whether a character is numeric, alphabetic, and so on?
How does pointer work in c?
How does free() know explain how much memory to release?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above