I know the & operator means address-of, but what's it do when in a function prototype?
void foo(std::string& str)
void foo(char& c)
what's the & for in that?
The & symbol means that you are passing the parameter to the function by "reference" rather than by "value". When the & symbol is next to a parameter, if you change that parameter in the function, that will change the variable that was passed to it when the function was called.