Objects and Classes

Q1: Which of the following statements is correct about the program given below?
class Aptitude
{
    public:
    static void MyFunction();
};
int main()
{
    void(*ptr)() = &Aptitude::MyFunction;
    return 0; 
}

A The program reports an error as pointer to member function cannot be defined outside the definition of class.

B The program reports an error as pointer to static member function cannot be defined.

C The program reports an error as pointer to member function cannot be defined without object.

D The program reports linker error.

ANS:A - The program reports an error as pointer to member function cannot be defined outside the definition of class.

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.