Jan 1, 2012 at 8:51pm UTC
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
Jan 1, 2012 at 8:57pm UTC
Did you forget to #include <iostream>?
Jan 1, 2012 at 9:00pm UTC
its ok, sorted just had to do std::ostream in header file - whoop, now just have to deal with infinite loop!