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 are the various situations where a copy constructor is invoked?

854


What are the differences between new and malloc?

833


Why do we need function?

816


Describe friend function & its advantages.

945


What are special characters c++?

756


What can c++ be used for?

832


What are the rules about using an underscore in a c++ identifier?

860


What are the types of container classes?

835


What is class and structure in c++?

793


What is the latest c++ version?

842


What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00

840


Can I learn c++ without learning c?

782


What is endl?

912


Why do we use the using declaration?

938


What is the output of the following program? Why?

863