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

When are exception objects created?

1061


Tell me difference between constant pointer and pointer to a constant.

1172


What is the auto keyword good for in c++?

1174


Describe linked list using C++ with an example.

1071


What are exceptions c++?

1026


What is a pointer how and when is it used?

1079


What's the best free c++ profiler for windows?

1072


What relational operators if statements in c++?

1160


List the issue that the auto_ptr object handles?

1017


What is while loops?

1039


Explain what are accessor methods?

1109


Can there be at least some solution to determine the number of arguments passed to a variable argument list function?

991


what are the iterator and generic algorithms.

1924


State the difference between delete and delete[].

1096


How new/delete differs from malloc()/free?

1131