Re: Writing to files




"Kat" <Rem.Intellegare@xxxxxxxxx> wrote in message
news:1148320886.240250.320670@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ok I'm currently working on a project that requires writing to external
files. I've seen many modes for opening files then writing to them.
This includes ios::out, ifstream::binary, and a couple of others.

My current program uses ofstream::binary to write to a file. I have a
test text file sitting in the same folder and every time I try to write
to it, I don't get an error message but it simply does not work(runtime
error). My guess is that I'm trying to write to an ASCII file when the
program is in binary mode but I can't be sure.

Please show the code that isn't working.


Is there a mode that will write to both ASCII and Binary or what mode
writes to ASCII files?



.



Relevant Pages

  • Writing to files
    ... I've seen many modes for opening files then writing to them. ... I don't get an error message but it simply does not work(runtime ... My guess is that I'm trying to write to an ASCII file when the ... program is in binary mode but I can't be sure. ...
    (microsoft.public.vc.language)
  • Re: test for binary mode?
    ... > maynard wrote: ... >> I have a class that reads a binary file and an ascii file. ... >> there is something stored in the ifstream object (or one of its base ... >> opened in binary mode. ...
    (microsoft.public.vc.language)
  • Re: using XML to write output files
    ... It's not very difficult as far as the 'writing' of it goes, ... There are other ways to get data into XML too, depending on your app, you ... > When I write an output data file, I usually write it as an ascii file. ... > and StreamWriter classes. ...
    (microsoft.public.dotnet.languages.csharp)
  • How to distinguish between binary and ASCII file on file opening?
    ... I am writing an applicatioin that will need to distinguish between ... binary and ASCII file to be loaded from hard disk so that different ...
    (microsoft.public.vc.mfc)
  • Re: How to convert binary file to ASCII file
    ... > How to convert binary file to ASCII file? ... if you use ifstream and ofstream, load it in binary mode, but re-write a ...
    (microsoft.public.vc.language)