What statements about this code are true?
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <iterator>

typedef std::ostream_iterator<int> int_output;

int main()
{
    std::set<int> s;
    s.insert(2);
    s.insert(3);
    s.insert(1);
    s.insert(2);
    std::vector<int>  vi(s.begin(), s.end());
    std::vector<bool> vb(s.begin(), s.end()); // 1
    std::vector<char> vc(s.begin(), s.end()); // 2
    std::copy(vi.begin(), vi.end(), int_output(std::cout));
    std::copy(vb.begin(), vb.end(), int_output(std::cout)); // 3
    std::copy(vc.begin(), vc.end(), int_output(std::cout)); // 4
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes