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
develop algorithms to add polynomials (i) in one variable
What is hashing in c?
How can I convert a number to a string?
What is getch c?
Is it possible to initialize a variable at the time it was declared?
How to define structures? ·
What is the data segment that is followed by c?
Explain what is a const pointer?
why programs in c are running with out #include
What are the Advantages of using macro
How can you restore a redirected standard stream?
What is a floating point in c?
What is typeof in c?
What is else if ladder?
What is a null pointer in c?