71. What is meant by ofstream in c++?
72. What is the use of reference member type in allocator?
73. Pick out the correct answer.
74. What are different operations are used in Pseudo-random number engines?
75. How many different ways are there to access an element of array classes at the ith position?
76. What will be the output of the following C++ code?
#include <iostream>
#include <vector>
#include <forward_list>
using namespace std;
int main()
{
forward_list<int> fl1 = {1,2,3,4,5};
for (int&c : fl1)
cout << c << " ";
cout<<endl;
forward_list<int>::iterator ptr = fl1.begin();
fl1.erase_after(ptr);
for (int&c : fl1)
cout << c << " ";
cout<<endl;
return 0;
}
#include <iostream>
#include <vector>
#include <forward_list>
using namespace std;
int main()
{
forward_list<int> fl1 = {1,2,3,4,5};
for (int&c : fl1)
cout << c << " ";
cout<<endl;
forward_list<int>::iterator ptr = fl1.begin();
fl1.erase_after(ptr);
for (int&c : fl1)
cout << c << " ";
cout<<endl;
return 0;
}77. Which of the following is correct way of copying the values of pair p1 into other pair p2?
78. What will be the output of the following C++ code?
#include <iostream>
#include <vector>
#include<iterator>
using namespace std;
int main ()
{
vector<int> myvector;
for (int i = 1; i <= 10; i++)
myvector.push_back(i);
myvector.erase (myvector.begin() + 6);
myvector.erase (myvector.begin(), myvector.begin() + 4);
for (unsigned i = 0; i < myvector.size(); ++i)
cout << ' ' << myvector[i];
return 0;
}
#include <iostream>
#include <vector>
#include<iterator>
using namespace std;
int main ()
{
vector<int> myvector;
for (int i = 1; i <= 10; i++)
myvector.push_back(i);
myvector.erase (myvector.begin() + 6);
myvector.erase (myvector.begin(), myvector.begin() + 4);
for (unsigned i = 0; i < myvector.size(); ++i)
cout << ' ' << myvector[i];
return 0;
}79. Which is the correct syntax of constructing a bitset?
80. In what form does the STL provides heap?
Read More Section(C plus plus miscellaneous)
Each Section contains maximum 100 MCQs question on C plus plus miscellaneous. To get more questions visit other sections.
- C plus plus miscellaneous - Section 1
- C plus plus miscellaneous - Section 2
- C plus plus miscellaneous - Section 3
- C plus plus miscellaneous - Section 4
- C plus plus miscellaneous - Section 5
- C plus plus miscellaneous - Section 6
- C plus plus miscellaneous - Section 8
- C plus plus miscellaneous - Section 9
- C plus plus miscellaneous - Section 10
- C plus plus miscellaneous - Section 11
