ExamVeda
Login
Home
31
Which of the following is an advantage of Forward iterator over input and output iterator?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
32
What does derived class does not inherit from the base class?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
33
In which type of semantics does c++ implements iterator?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
34
Which operators are part of RTTI?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
35
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; 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
36
Which is referred by pointers to member?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
37
Which of the following Operator cannot be used with pairs?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
38
How many types of Iterators are there?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
39
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;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
40
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;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board