differentiate between
const char *a;
char *const a; and
char const *a;
Answer Posted / vignesh1988i
const char *a : means the string is constant and the pointer
is not...
const char *a="HELLO WORLD" , if we take this example for
the whole scope of the program the string is constant and we
can't assign any other string to that pointer 'a'....
char * const a : means the pointer is constant (address) but
string is not......
char * const a="hello world" , if we take this example ,
here the address will be always constant.... string can vary..
char const *a : means string is a constant and pointer is
not..... as we have seen from the first example...
thank u
| Is This Answer Correct ? | 37 Yes | 2 No |
Post New Answer View All Answers
What are the types of operators in c?
What is a newline escape sequence?
Explain what are multibyte characters?
The file stdio.h, what does it contain?
Explain what is the difference between the expression '++a' and 'a++'?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
Explain what math functions are available for integers? For floating point?
What are the types of type qualifiers in c?
Can a pointer be volatile in c?
Write a program to implement queue.
How do I create a directory? How do I remove a directory (and its contents)?
What are control structures? What are the different types?
what is recursion in C
What is the difference between array and linked list in c?
What type is sizeof?