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
Where do I find the current c or c++ standard documents?
Write about an iterator class?
What is data types c++?
Name the implicit member functions of a class.
Explain object slicing in c++?
Is c++ the best programming language?
Why is polymorphism useful?
What is using namespace std in c++?
What is == in programming?
What is difference between c++ and c ++ 14?
Explain the register storage classes in c++.
What programming language should I learn first?
What is the difference between delegation and implemented-in-terms-of?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
What are the various operations performed on stack?