Why is (stl->vector) not printing to cout?

Hello all here is the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <set>
#include <vector>


int main() {

    std::set<std::string> setB {"1","2"};

    std::vector<std::string> input;
    int i = 0;
    for(auto const &item: setB){
      input.push_back(item);
    }

    for(auto const & item1: input){
        std::cout << item1 << std::endl;
    }
    return 0;
}


cout is not getting any data to print. Not sure what I may be overlooking.
Last edited on
It is? It's printing out 1 and 2. Which is what the vector contains? What exactly is the problem you're having?
Fixed. Ran a clean.
Topic archived. No new replies allowed.