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
How many different levels of pointers are there?
What are literals in C++?
What is overloading unary operator?
What methods can be overridden in java?
Explain the static storage classes in c++.
What is the latest c++ version?
Why is it necessary to use a reference in the argument to the copy constructor?
What is a storage class? Mention the storage classes in c++.
Who created c++?
Can turbo c++ run c program?
Write a function to find the nth item from the end of a linked list in a single pass.
Describe the advantages of operator overloading?
Can I learn c++ without c?
What are iterators in c++?
What is vector processing?