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 is enum c++?

1337


Difference between pointer to constant and constant pointer to a constant. Give example.

1177


Can class objects be passed as function arguments?

1117


How does the copy constructor differ from the assignment operator (=)?

1194


What is std :: endl?

1081


Is c++ the hardest language?

1035


What is extern c++?

1060


What c++ is used for?

1149


Can malloc be used in c++?

1131


Can a class be static in c++?

1144


Describe the role of the c++ in the tradeoff of safety vs. Usability?

1272


What is the use of data hiding?

1066


What is the most powerful coding language?

1107


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

1217


Is C++ case sensitive a) False b) Depends on implementation c) True

1135