Here is the whole code that I used to test the CountContact function
#include <iostream>
#include <string>
#include <vector>
void CountContact(const std::vector<std::string>& contacts);
...
Type: Posts; User: vart
Here is the whole code that I used to test the CountContact function
#include <iostream>
#include <string>
#include <vector>
void CountContact(const std::vector<std::string>& contacts);
...
when you need to modify object the pass by reference is only reasonable choice.
When you do not need to modify object - you can pass by const reference or by value...
For small types (let's say...
I would get rid of the global variable and pass the vector by reference or const reference to each function that should access it
for example
void CountContact(const...