How do you initialize a class member,
class x {
const int i;
};
Answer Posted / harminder
It can be done in the intialization list of the constructor
x():i=10
{
}
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
daily Routine of father
What is the use of pointer in c++ with example?
What is tellg () in c++?
Is c++ primer good for beginners?
What is a catch statement?
What is the role of C++ shorthand's?
What is the v-ptr?
Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?
Which software is best for programming?
What is expression parser in c++
Explain virtual destructor?
What is c++ array?
What is near, far and huge pointers? How many bytes are occupied by them?
What is object in c++ example?
what is C++ exceptional handling?