Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / d289

The error is in x not being referenced/initialized properly.

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are mutator methods in c++?

1168


what is Member Functions in Classes?

1207


Is java based off c++?

985


Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work

1084


Why can’t you call invariants() as the first line of your constructor?

1031


Does c++ support multilevel and multiple inheritances?

1014


Declare a class vehicle and make it an abstract data type.

970


What is std :: endl?

1043


What is the real purpose of class – to export data?

1115


Explain the static storage classes in c++.

1275


What is new in c++?

1104


What is the benefit of c++?

1138


Is string data type in c++?

1044


What is data hiding c++?

1050


What is a c++ map?

1416