Code:
#include <iostream>
#include <vector>
using std::cout;
using std::vector;
int main() {
vector <int> _v1;
vector <int> _v2;
_v1.push_back(3);
_v1.push_back(10);
_v1.push_back(33);
for(int x=0; x<_v1.size(); x++) {
cout<< _v1[x] << " ";
}
if(!_v1.empty()) {
_v1.clear();
}
_v2.push_back(10);
_v1.push_back(10);
if(_v1 == _v2) {
_v1.push_back(20);
}
_v1.switch(1, 2); // <---- DARN ERORS!! GGRRAAHH!!
for(int y=0; y<_v1.size(); y++) {
cout << _v1[y] << " ";
}
return 0;
}
I keep getting this error:
Code:
kleid@Shiva:~/Programming/Laboratory$ g++ vectors.cpp
vectors.cpp: In function `int main()':
vectors.cpp:28: error: parse error before `switch'