ExamVeda
Login
Home
51
Which of the following is correct about Input Iterators?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
52
How many types of sequence operations are provided by the C++ algorithm STL?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
53
What will be the output of the following C++ code?
#include <iostream>
#include <memory>
#include <string>
using namespace std;
int main ()
{
    string numbers[] = {"steve", "jobs"};
    pair <string*, ptrdiff_t> result = get_temporary_buffer<string>(2);
    if (result.second>0) 
    {
        uninitialized_copy ( numbers, numbers + result.second, result.first );
        for (int i = 0; i < result.second; i++)
            cout << result.first[i] << " ";
       return_temporary_buffer(result.first);
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
54
What kind of iteration does forward_list provide in C++?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
55
Which of the following header file is needed to use vectors in your program?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
56
What will be the output of the following C++ code?
#include <string>
#include <iostream>
using namespace std;
void string_permutation( string& orig, string& perm )
{
    if (orig.empty())
    {
        cout<<perm<<endl;
        return;
    }
    for (int i = 0; i < orig.size(); ++i)
    {
        string orig2 = orig;
        orig2.erase(i, 1);
        string perm2 = perm;
        perm2 += orig.at(i);
        string_permutation(orig2, perm2);
    }
}
int main()
{
    string orig = "ter";
    string perm;
    string_permutation(orig, perm);
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
57
What type of class template is list?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
58
Pick out the correct statement about vector.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
59
How do define the user-defined exceptions?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
60
What will be the output of the following C++ code?
#include <iostream>
#include <vector>
using namespace std;
int main ()
{
    vector<int> first;
    first.assign (7,100);
    vector<int>::iterator it;
    it=first.begin()+1;
    int myints[] = {1776,7,4};
    cout << int (first.size()) << '\n';
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board