1. Question: Which of the following sets of functions do not qualify as overloaded functions?

    A
    void fun(int, char *) void fun(char *,int)

    B
    void x(int,char) int *x(int,char)

    C
    int get(int) int get(int,int)

    D
    void F(int *) void F(float *)

    E
    All

    Note: Not available
    1. Report
  2. Question: Consider the sample code given below and answer the question that follows.
    template <class T> Run(T process);
    Which one of the following is an example of the sample code given above?

    A
    A non-template member function

    B
    A template function definition

    C
    A template function declaration

    D
    A template class definition

    E
    A template class declaration

    Note: Not available
    1. Report
  3. Question: Suppose MyClass is a class that defines a copy constructor and overloads the assignment operator. In which of the following cases will the copy constructor of MyClass be called?

    A
    When an object of MyClass is passed by value to a function

    B
    When an object of MyClass is returned by value from a function

    C
    MyClass object1; MyClass object2; object2 = object1;

    D
    MyClass object1; MyClass *object2 = new MyClass(object1);

    E
    MyClass object1; MyClass object2 = object1;

    Note: Not available
    1. Report
  4. Question: Which of the following STL classes is deprecated (ie should no longer be used)

    A
    ostrstream

    B
    ostringstream

    C
    ostream

    D
    wostream

    E
    None

    Note: Not available
    1. Report
  5. Question: Which of the following is a function that returns a non zero value to indicate an I/O stream error?

    A
    bad

    B
    good

    C
    fail

    D
    eof

    E
    err

    F
    error

    G
    filerror

    H
    None

    Note: Not available
    1. Report
  6. Question: Consider the following code:
    #include<iostream>
    using namespace std;
    
    class A
    {
    public:
      A()
      {
        cout << "Constructor of An";
      };
      ~A()
      {
        cout << "Destructor of An";
      };
    };
    
    class B
    {
    public:
      B()
      {
        cout << "Constructor of Bn";
      };
      ~B()
      {
        cout << "Destructor of Bn";
      };
    };
    
    class C
    {
    public:
      A objA;
      B objB;
    };
    
    int main()
    {
      C *pC;
      pC = new C();
      delete pC;
      return 0;
    }
    What will be the printed output?

    A
    Constructor of B Constructor of A Destructor of A Destructor of B

    B
    Constructor of A Constructor of B Destructor of B Destructor of A

    C
    Constructor of B Constructor of A Destructor of B Destructor of A

    D
    Constructor of A Constructor of B Destructor of A Destructor of B

    E
    The sequence of construction and destruction of A and B will be compiler specific

    Note: Not available
    1. Report
  7. Question: Which of the following is not a standard STL header?

    A
    <array>

    B
    <deque>

    C
    <queue>

    D
    <list>

    Note: Not available
    1. Report
  8. Question: Which of the following member functions can be used to add an element in an std::vector?

    A
    add

    B
    front

    C
    push

    D
    push_back

    Note: Not available
    1. Report
  9. Question: Which of the following is a predefined object in C++ and used to insert to the standard error output?

    A
    std::err

    B
    std::error

    C
    std::cerror

    D
    std::cerr

    E
    std::cin

    F
    std::clog

    Note: Not available
    1. Report
  10. Question: Consider the following code:
    #include<iostream>
    using namespace std;
    
    int main()
    {
    cout << "The value of __LINE__ is " <<__LINE__;
    
    return 0;
    }
    What will be the result when the above code is compiled and executed?

    A
    The compilation will fail with the error - '__LINE__' : undeclared identifier

    B
    The compilation will fail with the error - '__LINE__' unresolved identifier

    C
    The code will compile and run without errors

    D
    The code will crash at runtime

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd