class HasStatic {
static int I;
};
Referring to the sample code above, what is the appropriate
method of defining the member variable "I", and assigning it
the value 10, outside of the class declaration?
a) HasStatic I = 10;
b) int static I = 10;
c) static I(10);
d) static I = 10;
e) int HasStatic::I = 10;



class HasStatic { static int I; }; Referring to the sample code above, what is the approp..

Answer / guest

Ans e)

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More C++ General Interview Questions

Tell me difference between constant pointer and pointer to a constant.

0 Answers   Honeywell, Zomato,


How do you print for example the integers 3,2,1,5,4 in a binary tree within the console in format where it looks like an actual binary tree?

0 Answers  


What is a reference in C++?

1 Answers  


When is a template better solution than a base class??

2 Answers   emc2,


What is an undefined behavior and sequence points

0 Answers  






What is the difference between passing by reference and passing a reference?

0 Answers  


How can you differentiate between inheritance and implementation in c++?

0 Answers  


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

0 Answers  


What is c++ array?

0 Answers  


What does new in c++ do?

0 Answers  


What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number

0 Answers  


Explain the difference between class and struct in c++?

0 Answers  


Categories