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 the main use of c++?
How much maximum can you allocate in a single call to malloc()?
Explain bubble sorting.
What are single and multiple inheritances in c++?
Is ca high or low level language?
What are punctuators in c++?
Explain class invariant.
Explain some examples of operator overloading?
What is #include c++?
What is a class definition?
Can we use clrscr in c++?
How would you differentiate between a pre and post increment operators while overloading?
What are the advantages of using const reference arguments in a function?
What is the difference between mutex and binary semaphore?
What is a modifier in c++?