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

Can non-public members of another instance of the class be retrieved by the method of the same class?

1049


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

1220


What is extern c++?

967


Do you know about latest advancements in C++ ?

1184


What is a dynamic binding in c++?

924


How would you implement a substr() function that extracts a sub string from a given string?

1006


Why c++ is better than c language?

979


What is c++ stringstream?

1064


What is main function in c++ with example?

1170


What do you mean by funtion prototype?

1020


What relational operators if statements in c++?

1136


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

966


Which programming language is best to learn first?

1025


What does flush do?

954


Are there any special rules about inlining?

1039