Multiple Arguments

Hi, I'm trying to make a project and I'm really confused. I have vectors to save values, and I want to pass arguments just to execute specific blocks of my code. When I pass one argument per time all works perfect and my programm ends, all data from vectors remove. I want to pass multiple arguments and the vector's value stays for the end-argument which output the vectors in a file, to be more specific blocks add and remove data from vectors, and I want to pass add-argument and remove-argument until the end-argument and the output file will have the final vector's content.
Showing code would help more than an explanation. I'm assuming you might be passing data by value and not by reference (by using '&'):

1
2
3
4
5
6
7
8
9
10
11
void function(std::vector<int> &a)
{

//do stuff
}

int main ()
{
    std::vector<int> a;
    function(a);
}
Topic archived. No new replies allowed.