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
Is c better than c++?
Is c# written in c++?
What is string in c++ programming?
What is time_t c++?
Can we use this pointer inside static member function?
What is general form of pure virtual function? Explain?
Why c++ is the best language?
Will this c++ program execute or not?
Specify different types of decision control statements?
What is heap sort in c++?
What is type of 'this' pointer? Explain when it is get created?
Is swift better than c++?
What is c++ stringstream?
What is the difference between #define debug 0 and #undef debug?
What is the use of :: operator in c++?