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
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
What are the uses of typedef in a program?
Explain stack unwinding.
What is format for defining a structure?
What is the difference between map and hashmap in c++?
Which c++ compiler is best?
describe private access specifiers?
What are virtual functions in c++?
What size is allocated to the union variable?
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
Mention the purpose of istream class?
What is the role of static keyword for a class member variable?
Explain how functions are classified in C++ ?
what is c++
What sorting algorithm does c++ use?