const char *
char * const
What is the differnce between the above two?
Answer Posted / p s
const char *s; is a non-const pointer to const char
char * const s; is a const pointer to non-const char
Once u assign a value to the const poinet it cannot be
reassigned another value till u use casting techniques..
char a = 'A';
char b = 'B';
char *const c = &a;
c = &b; //flags an errror
const char *s = &a;
s = &b //works
| Is This Answer Correct ? | 19 Yes | 0 No |
Post New Answer View All Answers
What is the latest version on c++?
What is different in C++, compare with unix?
How delete [] is different from delete?
What is c++ virtual inheritance?
How can you specify a class in C++?
What's the "software peter principleā?
What is struct c++?
Why do we use classes in c++?
Implement stack operations with pointers with appropriate exception checks.
Can manipulators fall in love?
What do you mean by translation unit?
How const int *ourpointer differs from int const *ourpointer?
What is meant by iomanip in c++?
what is the use of void main() in C++ language?
What is lazy initialization in c++?