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
Explain what are the standard predefined macros?
What are the 4 types of organizational structures?
Sir i need notes for structure,functions,pointers in c language can you help me please
Explain goto?
Which is more efficient, a switch statement or an if else chain?
Can main () be called recursively?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
What does. int *x[](); means ?
Why is it that not all header files are declared in every C program?
Does c have function or method?
What is the c value paradox and how is it explained?
What is the g value paradox?
How do you print only part of a string?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?