Just a piece of advice. Instead of writing
for (int i=0; i=((Main.size())-1); i++) {
cout << Main[i] << '\n';
}
as suggested above, write a:
for (vector<double>::iterator it=Main.begin(); it!=Main.end(); it++) {
cout << *it << '\n';
}
to use iterators. If you have C++11
support, you can declare i
as auto i=Main.begin()
(just a handy shortcut though)
This avoids the nasty one-position-out-of-bound error caused by leaving out a -1
unintentionally.