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
Mention the purpose of istream class?
What is istream and ostream in c++?
Explain the uses oof nested class?
What does it mean to declare a destructor as static?
Explain the difference between realloc() and free() in c++?
What do the keywords volatile and mean mutable?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
Differentiate between late binding and early binding.
What is the best book for c++ beginners?
What are the advantage of using register variables?
Which one between if-else and switch is more efficient?
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
How will you call C functions from C ++ and vice-versa?
Do vectors start at 0 c++?
What is function declaration in c++ with example?