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 are the decision making statements in C++? Explain if statement with an example?
What is the difference between interpreters and compilers?
Can a constructor return a value?
What is a vector c++?
Is there a sort function in c++?
When must you use a pointer rather than a reference?
What language is a dll written in?
Are vectors faster than arrays?
What kind of problems can be solved by a namespace?
Explain what data encapsulation is in c++?
What is flush programming?
What is the this pointer?
Define macro.
What is vector pair in c++?
What is function overloading c++?