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 |
What is the this pointer?
What is a memory leak c++?
why we cant create array of refrences
List out some of the OODBMS available?
WHAT IS THE ABREVATION OF FORTRAN?
What is purpose of abstract class?
Can comments be longer than one line?
What are the effects after calling the delete this operator ?
Write a corrected statement in c++ so that the statement will work properly. x =+ 7;
In a function declaration what does extern means?
Why c++ is not a pure oop language?
What will happen if a pointer is deleted twice?