I am newbie in c++. I wanna create function that push_back
value to vector.
#include <vector>
#include <iostream>
using namespace std;
void pushVector ( vector <int> v, int value){
v.push_back(value);
}
int main(){
vector <int> intVector;
pushVector (intVector, 17);
cout << intVector.empty(); // 1
}
As you see, my function don't push_back
value in vector. Where is my mistake?