Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!nowhere!sking From: sking@nowhere.uucp (Steven King) Newsgroups: comp.lang.c++ Subject: Re: Changing cout mode to ios::binary in Borland C++ Message-ID: <1991May07.170557.7250@nowhere.uucp> Date: 7 May 91 17:05:57 GMT References: <91123.104535UH2@psuvm.psu.edu> <91126.163800UH2@psuvm.psu.edu> Organization: American Anarchist Union Lines: 39 In article <91126.163800UH2@psuvm.psu.edu> UH2@psuvm.psu.edu (Lee Sailer) writes: >For those of you who might be interested, it looks like this might be >"impossible." I got several suggestions for the obvious workarounds, but >I need the real solution in this case. Oh well. One response was >especially interesting, and seemed like it might be of general enough >interest that I've decided to post it here. I've edited it to >preserve the authors anonymity. If he wanted it posted under his >name, I guess he'd have done so. > >So, an anonymous author says.... > [ anon message why it might not be good to do this ] I dont know about borland, but microsoft c provides a "setmode" function in their C lib to do this, and it works on stdout. ie.: #include extern "C" int setmode ( int, int ) ; #define O_BINARY 0x8000 main ( ) { cout << "foo\n" << flush ; setmode ( 1, O_BINARY ) ; cout << "foo bar\n" << flush ; } I would be very surprised if borland didnt provide something with the same functionality... -- If it don't stick, stink, or sting It ain't from Texas. ..!cs.utexas.edu!ut-emx!nowhere!sking