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

Can a constructor return a value?

573


Difference between pass by value and pass by reference?

597


Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes

581


What is the role of copy constructor in copying of thrown objects?

593


Why #include is used?

613






Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .

678


How would you use the functions randomize() and random()?

625


When does a name clash occur in c++?

711


What is the use of pointer in c++ with example?

559


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

1499


Why do we need runtime polymorphism in c++?

555


What are proxy objects in c++?

639


How is static data member similar to a global variable?

576


Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].

599


Define vptr.

594