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
Differentiate fundamental data types and derived data types in C.
Write a code on reverse string and its complexity.
What is sizeof int in c?
Is linux written in c?
What are different types of variables in c?
What is use of #include in c?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
What are multibyte characters?
Can a pointer be volatile in c?
What is meant by realloc()?
What is the purpose of type declarations?
Are pointers integers in c?
How do we print only part of a string in c?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream