What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / ashish
here a is an array and is a char const * data type.
hence u cannot change value of a but u can change the value
which a points to.
p on the other hand is a const char * data type.
hence value of p an be changed but the value p points to
cannot be changed.
i dont know the answer!!! :P
Is This Answer Correct ? | 3 Yes | 13 No |
Post New Answer View All Answers
How do you search data in a data file using random access method?
What happens if header file is included twice?
When do we get logical errors?
Explain continue keyword in c
Is c object oriented?
What are the application of c?
How to set file pointer to beginning c?
Tell me is null always defined as 0(zero)?
What is %g in c?
What is spaghetti programming?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
How do I get an accurate error status return from system on ms-dos?
Can we initialize extern variable in c?
What is the purpose of 'register' keyword in c language?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters