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.
Answers were Sorted based on User's Feedback
Answer / d289
The error is in x not being referenced/initialized properly.
| Is This Answer Correct ? | 1 Yes | 4 No |
What is ios class in c++?
What is #include iostream?
What you know about structures in C++?
0 Answers Agilent, ZS Associates,
What are the advantages of using friend classes?
Can a Structure contain a Pointer to itself?
Can member data be public?
Is c++ the best programming language?
How did c++ start?
What is the difference between Pointer and a Reference? When you would use them?
Will a catch statement catch a derived exception if it is looking for the base class?
what is VOID?
What is Virtual Inheritance?