class X
{
public:
int x;
static void f(int z);
};
void X::f(int y) {x=y;}
What is the error in the sample code above?
a) The class X does not have any protected members.
b) The static member function f() accesses the non-static z.
c) The static member function f() accesses the non-static x.
d) The member function f() must return a value.
e) The class X does not have any private members.
Answer Posted / guest
option 'c' is the answer
| Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
Do class method definitions?
Why is main an int?
What is static class data?
Define a pdb file.
How to defines the function in c++?
Should I learn c or c++ or c#?
What is const in c++?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
What are signs of manipulation?
When should we use multiple inheritance?
What is the basic concept of c++?
What is main function in c++ with example?
Is java as fast as c++?
Explain the use of vtable.