I’m trying to write a function that writes information to a stream. I need to be able to pass it either a stringstream or an ostream. I tried declaring the function with F(std::ios* out), but then later when I use the << operator to write to it, I get this error: error: no match for operator<<. How should I be declaring the function?
I’m trying to write a function that writes information to a stream. I need
Share
I think you are looking for c++ references
would do the trick; Note that this will assume
charstreams, otherwise: