add using namespace std; after include all libraries, it will make your life easier.
|
Do not do that. It might make it a tad easier now, but you'll get fucked in the future. Stick to using
std::
Pretty much anyone who knows their shit will tell you the same.
Edit: If you actually want to make your life easier, use the c++11 feature called "auto"
instead of writing this -
for (iter1 = c1.begin(); iter1 != c1.end(); ++iter1)
You just write this -
for (auto& iter1 : c1)
Edit 2: This works fine for me. They are beinged pushed back into two different vectors -
http://gyazo.com/b3298630539d81b2603ff5f5be2c91e3
Edit 3: If you want
THE ACTUAL USER INPUT to be pushed back into each vector. Then why are you using a for-loop, and why are you pushing back "i" in the first one?
Instead, push back the user input like you want right?
c1.push_back(a);
and
c2.push_back(b);
http://gyazo.com/838d1bf2d95faf8b14d358372523f092
Edit 4: If you wanna do what fg109 suggested under, which Im guessing is, then make your vectors of strings, not double.