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
How many levels of pointers can you have?
Are bit fields portable?
What is scanf () in c?
What are register variables in c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
Why we use conio h in c?
Does c have circular shift operators?
What are the 5 elements of structure?
What is structure pointer in c?
Compare array data type to pointer data type
What is type qualifiers?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
What are the types of type specifiers?
What are derived data types in c?
What are runtime error?