Function Implementation help!


I'm working with this function below:

 void print(std::string arr[], int n, std::ostream &os=std::cout);

I'm trying to implement this function, using the third parameter as the left-hand operand so instead of writing,
cout << "{"
I use
os << "{".
However I'm getting a GCC error that my "os was not declared in this scope".

Has anybody dealt with this before? I'm absolutely lost!
Last edited on
Show the statement where the error occured.
Topic archived. No new replies allowed.