Standard Library Design(C++ Programming ) Questions and Answers
Explanation:-
Answer: Option A. -> It is the collection of class definitions for standard data structures and a collection of algorithmsIt is the collection of class definitions for standard data structures. This part of the library was
derived from the Standard Template Library.
Question 5.
1.
#include
2.
#include
3.
#include
4.
using namespace std ;
5.
typedef list LISTSTR;
6.
int main()
7.
{
8.
LISTSTR :: iterator i;
9.
LISTSTR test;
10.
test.insert(test.end(), "one");
11.
test.insert(test.end(), "two");
12.
LISTSTR test2(test);
13.
LISTSTR test3(3, "three");
14.
LISTSTR test4(++test3.begin(),
15.
test3.end());
16.
cout
What is the output of this program?
1.
#include
2.
#include
3.
#include
4.
using namespace std ;
5.
typedef list LISTSTR;
6.
int main()
7.
{
8.
LISTSTR :: iterator i;
9.
LISTSTR test;
10.
test.insert(test.end(), "one");
11.
test.insert(test.end(), "two");
12.
LISTSTR test2(test);
13.
LISTSTR test3(3, "three");
14.
LISTSTR test4(++test3.begin(),
15.
test3.end());
16.
cout
Explanation:-
Answer: Option D. -> None of the mentionedIn this program, We used the list to manipulate the given value.
Output:
$ g++ std3.cpp
$ a.out
test: one
two
test: one
two
test: three
three
three
test: three
three
Explanation:-
Answer: Option B. -> abcIn this program, We used the queue to process the given input.
Output:
$ g++ std1.cpp
$ a.out
abc
Explanation:-
Answer: Option D. -> 42 for 10 timesIn this program, We used the vector to print the 42 for 10 times.
Output:
$ g++ std.cpp
$ a.out
42 42 42 42 42 42 42 42 42 42