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 |
How much maximum can you allocate in a single call to malloc()?
Generally variables are stored in heap memory. When he variables are created in stack?
What is virtual methods?
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
What is the difference between a pointer and a link in c ++?
What is the exit function in c++?
What are shallow and deep copy?
What are literals in C++?
How do you clear a map in c++?
Describe exception handling concept with an example?
Describe friend function & its advantages.
Define token in c++.