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
Can a constructor return a value?
Difference between pass by value and pass by reference?
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
What is the role of copy constructor in copying of thrown objects?
Why #include is used?
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 .
How would you use the functions randomize() and random()?
When does a name clash occur in c++?
What is the use of pointer in c++ with example?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
Why do we need runtime polymorphism in c++?
What are proxy objects in c++?
How is static data member similar to a global variable?
Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].
Define vptr.