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;

Answer Posted / guest

Ans e)

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What causes a runtime error c++?

589


Why is c++ still best?

554


What are the various access specifiers in c++?

603


Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?

2016


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

704






Is c++ fully object oriented?

553


Write a c program for binary addition of two 8 bit numbers.

3668


What do you mean by global variables?

572


Ask to write virtual base class code?

2151


What are disadvantages of pointers?

568


What is class syntax c++?

595


What is the difference between an external iterator and an internal iterator?

614


What new()is different from malloc()?

571


What do you mean by stack unwinding in c++?

732


What are the two types of comments?

576