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
What is the difference between new and malloc functions?
code for replace tabs with equivalent number of blanks
What is the difference between class and object in c?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Explain how many levels deep can include files be nested?
Explain the difference between exit() and _exit() function?
What is pivot in c?
code for quick sort?
How does sizeof know array size?
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.. :(
What is character set?
Why is extern used in c?
What is the difference between procedural and functional programming?
What are the __date__ and __time__ preprocessor commands?
What is the explanation for prototype function in c?