You should probably pass the vector as an argument to the function. The concept of functions taking argents is pretty basic – please read an introductory tutorial and/or the relevant part of the Book instead of asking here.
If there are a lot of args, you could consider a configuration struct to pass as a single argument.
The alternative is to use a global variable, but that is almost certainly not what you want, and I would highly recommend avoiding doing that. It often causes more problems that it solves.
The speed difference for passing this as an argument is almost always going to be practically non-existent.