How do you initialize a class member,
class x {
const int i;
};

Answer Posted / pc1989

x variable();

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #include iomanip?

797


What are the advantages of using friend classes?

921


What causes a runtime error c++?

861


Explain unexpected() function?

858


What is the type of 'this' pointer? When does it get created?

763


What is Destructor in C++?

982


What is difference between class and structure in c++?

917


Is map ordered c++?

873


Explain how to initialize a const data member.

894


What are the benefits of operator overloading?

940


Is c the same as c++?

803


What is the difference between #import and #include in c++?

872


How one would use switch in a program?

862


Can circle be called an ellipse?

871


Differentiate between late binding and early binding. What are the advantages of early binding?

832