View Single Post
Old Jan 28th, 2006, 10:57 AM   #8
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 266
Rep Power: 4 Cache is on a distinguished road
@Ooble: I don't want to sound like an ass, but there are a few basic mistakes in the code you posted above. Although you did only say it's "like" the way you would do it, at least.

Take a look at the return type in the prototype of 'writeNumbers' - then look at the return type in it's definition. Your missing a 'std::' on one of your cin's. And when you open the file stream, perhaps you meant: std:: ofstream out( filename.c_str() ); (I put the space to avoid a smiley face).


There's one more thing, but it's more of question: in the code you posted above, you synchronize the output buffer using 'std::cout.sync();'. Is that valid? Dev-C++ spits and error about this. The error: 'struct std::ostream' has no member named 'sync'
Cache is offline   Reply With Quote