How do you initialize a class member,
class x {
const int i;
};
Answer Posted / gayatri
using constructor we can initialize a class member in public
part of class.
class x
{
private: int i;
public: x()
{
i = 10;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Describe the setting up of my member functions to avoid overriding by the derived class?
Is it possible for a member function to delete the pointer, named this?
What is #include cmath?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
Is c++ a high level language?
Which software is best for coding?
What is rtti in c++?
What are the differences between java and c++?
What does scope resolution operator do?
What are the advantages of early binding?
Why ctype h is used in c++?
What are the different types of comments allowed in c++?
What is the use of setfill in c++?
What do you mean by const correctness?
Why are pointers not used in c++?