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
Answer / d289
The error is in x not being referenced/initialized properly.
Is This Answer Correct ? | 1 Yes | 4 No |
which of the following is not an secondary constant a) array b) real c) union
Is it possible for a member function to use delete this?
what is difference between internet and Internet?
12 Answers College School Exams Tests, Microsoft, MIT, TCS,
Define a nested class. Explain how it can be useful.
Under what conditions is multiple inheritance not recommended?
What is the difference between = and == in C?
16 Answers Christ University, Intel,
What is the function to call to turn an ascii string into a long?
What is atoi?
What is difference between c++ 11 and c++ 14?
What is the difference between structures and unions?
Explain all the C++ concepts using examples.
Write about a nested class and mention its use?