Standard Library


  1. What is the output of this program?
    #include <iostream>
    #include <list>
    #include <queue>
    using namespace std;
    int main()
    {
    queue<char> que;
    que.push('I');
    que.push('L');
    que.push('U');
    cout << que.front() << " ";
    que.pop();
    cout << que.front() << " ";
    que.pop();
    cout << que.front();
    que.pop();
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    In this program, We used the queue to process the given input.


  1. What is the output of this program?
    #include <iostream>
    #include <vector>
    using namespace std;
    int main()
    {
    vector<int> vect;
    vect.assign( 5, 50 );
    for (int k = 0; k < vect.size(); k++)
    {
    cout << vect[k] << " ";
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    In this program, We used the vector to print the 50 for 5 times.



  1. What is meant by vector in the container library contains?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    vector in the container library contains sequence container that manipulates and encapsulates dynamic size arrays.


  1. Which is best for coding the standard library for c++?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    * complex objects are returned by value.
    * have a member-swap().
    * no trailing underscores on names.



  1. Pick out the wrong header file about strings.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The standard header files for string is string and regex. So the wrong one presented here is ios.