Question 1 of 25
Hints left: 3
Q1
Which exception is thrown if the typecasting is not done properly?
Q2
Which operators are part of RTTI?
Q3
Which of the following Operator cannot be used with pairs?
Q4
Which of the following is corect way of constructing bitset using integer number?
Q5
How to handle error in the destructor?
Q6
Which is referred by pointers to member?
Q7
In which type of semantics does c++ implements iterator?
Q8
What kind of locale does every program is having in C++?
Q9
What does the checked iterator allow you to find?
Q10
What should be the name of the constructor?
Q11
Which of the following is an advantage of Forward iterator over input and output iterator?
Q12
What will be the output of the following C++ code? #include <iostream> #include <vector> using namespace std; int main() { vector<int> v; for (int i = 1; i <= 5; i++) v.push_back(i); cout<<v.capacity()<<endl; v.pop_back(); v.pop_back(); cout<<v.capacity()<<endl; return 0; }
Q13
What does derived class does not inherit from the base class?
Q14
What is the header file for vector permutation?
Q15
What will be the output of the following C++ code? #include <iostream> #include <algorithm> #include <vector> using namespace std; int main () { int first[] = {5, 10, 15}; int second[] = {50, 40, 30}; vector<int> v(4); vector<int> :: iterator it; sort (first, first + 3); sort (second, second + 3); it = set_symmetric_difference (first, first + 2, second, second + 2, v.begin()); v.resize(it - v.begin()); for (it = v.begin(); it != v.end(); ++it) cout << ' ' << *it; return 0; }
Q16
How many ways are there to use functors?
Q17
What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstring> using namespace std; template <class type> type MyMax(const type Var1, const type Var2) { cout << "no specialization"; return Var1 < Var2 ? Var2 : Var1; } template <> const char *MyMax(const char *Var1, const char *Var2) { return (strcmp(Var1, Var2)<0) ? Var2 : Var1; } int main() { string Str1 = "class", Str2 = "template"; const char *Var3 = "class"; const char *Var4 = "template"; const char *q = MyMax(Var3, Var4); cout << q << endl; return 0; }
Q18
Which block should be placed after try block?
Q19
How many parameters are available in partial_sum function in c++?
Q20
Which of the following is the limitation of bitset over vector bool?
Q21
How many parameters are needed for minmax function?
Q22
How many types of Iterators are there?
Q23
What will be the output of the following C++ code? #include <iostream> #include <exception> #include <typeinfo> using namespace std; class Test1 { virtual int Funct() { } }; int main () { try { Test1 * var = NULL; typeid (*var); } catch (std::exception& typevar) { cout << "Exception: " << typevar.what() << endl; } return 0; }
Q24
How many objects are used for input and output to a string?
Q25
What will be the output of the following C++ code in text files? #include <stdio.h> int main () { char buffer[BUFSIZ]; FILE *p1, *p2; p1 = fopen ("myfile.txt", "w"); p2 = fopen ("myfile2.txt", "a"); setbuf ( p1 , buffer ); fputs ("Buffered stream", p1); fflush (p1); setbuf ( p2 , NULL ); fputs ("Unbuffered stream", p2); fclose (p1); fclose (p2); return 0; }