Questions and Answers


  1. What is meant by type_info?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Used to hold the type information returned by the typeid operator


  1. Which interface in the container is required for storage management?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Memory interface



  1. How many sets of requirements are need in designing a container?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    There are three sets of requirements. They are container interface requirements, Allocator interface requirements and iterator requirements.


  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    struct N
    {
    virtual void fun()
    {
    cout << "Class N" << endl;
    }
    };
    struct M : N
    {
    virtual void fun()
    {
    cout << "Class M" << endl;
    }
    };
    struct O : N
    {
    virtual void fun()
    {
    cout << "Class O" << endl;
    }
    };
    void fun(N* argumnet)
    {
    M* ptr1 = dynamic_cast<M*>(argumnet);
    O* ptr2 = dynamic_cast<O*>(argumnet);
    if (ptr1)
    ptr1 -> fun();
    else if (ptr2)
    ptr2 -> fun();
    else
    argumnet -> fun();
    };
    int main()
    {
    N Object1;
    O Object2;
    N* ptr1 = &Object2;
    N* ptr3 = &Object1;
    fun(ptr1);
    fun(ptr3);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    In this program, We applied the dynamic casting to structure and produced the output.



  1. What is meant by garbage collection?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The garbage collection attempts to reclaim memory occupied by objects that are no longer in use by the program.