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
What is #include iomanip?
What is input operator in c++?
What is atoi in c++?
Define a conversion constructor?
Comment on local and global scope of a variable.
Is there finally in c++?
What things would you remember while making an interface?
How do you flush a buffer in c++?
What does obj stand for?
What is the difference between reference and pointer?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
Name the debugging methods that are used to solve problems?
How one would use switch in a program?
Can a built-in function be recursive?
What is enum c++?