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
Will the following program execute?
Are c and c++ different?
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].
Explain the difference between new() and malloc() in c++?
the maximum length of a character constant can be a) 2 b) 1 c) 8
Differentiate between a constructor and a method in C++.
What is encapsulation in c++?
What is class invariant in c++?
Why can templates only be implemented in the header file?
What's the best free c++ profiler for windows?
What is binary object model?
What is an arraylist c++?
Does c++ have finally?
Describe the advantage of an external iterator.
How to give an alternate name to a namespace?