Message-ID: <00a101bda655$798f3020$200d18ac@OSEK12.hosp.dk> From: "=?iso-8859-1?Q?S=F8ren_Merser?=" To: "DJGPP" Subject: Re: writing binary data Date: Fri, 3 Jul 1998 09:37:43 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Precedence: bulk I'm using Outlook Ekspress with 'plain text.' If encoded, what more do I haveto do? My problem is writing a binary file using STL and iostream; I thought that this should work: vector v; - populate vector and print vector to stdout - works fine OK // open output file stream in binary mode ofstream ofs("data.dat", ios::out | ios::bin | ios::trunc ); // create iterator ostream_iterator ofi(ofs," "); // write to file copy(v.begin(), v.end(), ofi); This code compiles but just writes an odinary asci file?? Any help appreciated