Passing ostream into a function

happy New Year everyone!

I just had a question about passing an ostream into a function. My main calls this function print_braille(char* string, cout); with cout being the ostream. In the function main, I have written:

#include<fstream> // and others ..... //

void print_braille(const char* plaintext, ostream & output){
................ }

in my header file I have written:

void print_braille(const char* plaintext, ostream& output);

Yet I get the error:

In file included from braille.cpp:6:
braille.h:8: error: âostreamâ has not been declared

So I don't really know what is going well.

Thanks for any help in advance!

- Ruby
Did you forget to #include <iostream>?
nooo checked that too!
its ok, sorted just had to do std::ostream in header file - whoop, now just have to deal with infinite loop!
Topic archived. No new replies allowed.