Standard Library
- 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();
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
In this program, We used the queue to process the given input.
- 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] << " ";
}
}
-
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.
- What is meant by vector in the container library contains?
-
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.
- Which is best for coding the standard library for c++?
-
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.
- Pick out the wrong header file about strings.
-
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.