What is the difference between char a[] = "string"; and
char *p = "string"; ?

Answer Posted / srinivas

a is a const pointer, whereas p is not
meaning 'a' will point to a fixed location (value of 'a' or
address of *a can't change, remains fixed) - though
contents of a can be changed (by way of accessing a[i])

Is This Answer Correct ?    36 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is call by reference in functions?

850


Why do we use header files in c?

777


What was noalias and what ever happened to it?

762


What is bubble sort in c?

803


What are file streams?

755






What is the condition that is applied with ?: Operator?

853


Is it possible to pass an entire structure to functions?

735


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

877


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

949


How do you use a 'Local Block'?

903


When would you use a pointer to a function?

778


Define macros.

996


What is unsigned int in c?

720


Does c have function or method?

776


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1620