adspace


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


Please Help Members By Posting Answers For Below Questions

daily Routine of father

1485


Can union be self referenced?

1268


What character terminates all character array strings a) b) . c) END

1397


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1165


What is the latest version on c++?

1209