Hey,
How can i make Non-ASCII (Binary) Output to files using MSC++ 6's File Stream Classes??
I Hope my Question is Clear
Cya.
Hey,
How can i make Non-ASCII (Binary) Output to files using MSC++ 6's File Stream Classes??
I Hope my Question is Clear
Cya.
I thinkCode:int n=800; ostream out("file",ios :: binary|ios :: out) out.write((char *) &n,sizeof n);
Last edited by Panopticon; 02-03-2003 at 11:15 PM.
I AM WINNER!!!1!111oneoneomne
This Doesn't seem to work, Does somebody else know how to do this??
It should work. I had a typo before, forgot to end the declaration with a semicolon.
I AM WINNER!!!1!111oneoneomne
I'm sorry, but it doesn't work. I noticed the Semi-Colon Error Before, i fixed this before even using the Code.
Is there another way??
There are many different ways, but if you tell us what exactly "doesn't work" we could help you fix this one.
int n=800;
ofstream out;
out.open( "filename", ios::binary );
if( out.fail() ) // do something, file not opened
out.write( &n, sizeof( n ) );
out.close();
http://www.cplusplus.com/ref/iostrea...eam/write.html
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.