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 is printf () in c?
What is meant by inheritance?
What are type modifiers in c?
What are the key features in c programming language?
How can I sort a linked list?
What functions are used in dynamic memory allocation in c?
How do you do dynamic memory allocation in C applications?
What is difference between class and structure?
Write a program to print ASCII code for a given digit.
The statement, int(*x[]) () what does in indicate?
What is a substring in c?
What is a program?
Explain how can I read and write comma-delimited text?
List the difference between a While & Do While loops?
What are the advantages of using macro in c language?