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 / guest
option 'c' is the answer
| Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
What is late binding c++?
What are c++ variables?
How static variables and local variablesare similar and dissimilar?
Is c better than c++?
How are Structure passing and returning implemented by the compiler?
Write a program in C++ for Fibonacci series
Show the declaration for a pointer to function returning long and taking an integer parameter.
When does a 'this' pointer get created?
write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.
Which function cannot be overloaded c++?
What are c++ redistributables?
What is time h in c++?
Describe the role of the c++ in the tradeoff of safety vs. Usability?
What are advantages of c++?