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

What is encapsulation in c++?

0 Answers  


In a class only declaration of the function is there but defintion is not there then what is that function?

5 Answers   Hughes,


Why we use #include conio h in c++?

0 Answers  


What is Object Oriented programming.what is the difference between C++ and C?

8 Answers   Infosys,


Are there any new intrinsic (built-in) data types?

1 Answers  






Difference between static global and global?

16 Answers   Microsoft, Symphony, Wipro,


Assume an array of structure is in order by studentID field of the record, where student IDs go from 101 to 500. Write the most efficient pseudocode algorithm you can to find the record with a specific studentID if every single student ID from 101 to 500 is used and the array has 400 elements. Write the most efficient pseudocode algorithm you can to find a record with a studentID near the end of the IDs, say in the range from 450 to 500, if not every single student ID in the range of 101 to 500 is used and the array size is only 300

0 Answers  


What is singleton class in c++?

0 Answers  


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

0 Answers  


Does c++ support multilevel and multiple inheritances?

0 Answers  


What are the advantages of using typedef in a program?

0 Answers  


What are multiple inheritances (virtual inheritance)?

0 Answers  


Categories