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.

Answers were Sorted based on User's Feedback



class X { public: int x; static void f(int z); }; void X::f(int y) {x=y;} What i..

Answer / guest

option 'c' is the answer

Is This Answer Correct ?    12 Yes 2 No

class X { public: int x; static void f(int z); }; void X::f(int y) {x=y;} What i..

Answer / d289

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

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C++ General Interview Questions

In which memory a class gets stored(in heap /in stack)? And why??

2 Answers  


What is a wchar_t in c++?

0 Answers  


Describe Trees using C++ with an example.

0 Answers  


Which operator can not be overloaded in C++?

1 Answers  


What is an Iterator class?

1 Answers  


Explain bubble sorting.

0 Answers  


Explain "passing by value", "passing by pointer" and "passing by reference" ?

5 Answers  


Describe public access specifiers?

0 Answers  


What is a forward referencing and when should it be used?

0 Answers  


Is oops and c++ same?

0 Answers  


What is a built-in function?

1 Answers  


total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

0 Answers  


Categories