Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #5857

Re: File Manipulation?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: File Manipulation?
Date Tue, 31 May 2011 12:24:42 +1200
Lines 25
Message-ID <94iqqaFr2iU13@mid.individual.net> (permalink)
References <c32da847-b415-4ba3-954c-e51ee8cbf5ff@e35g2000yqc.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net Weekmp5DX/EkF1hdRXSIMAX2xVlyxftWZfZeTlAMocK1aXQkDo
Cancel-Lock sha1:Pt8auSF6Edklu86XbbZAnYWKzpE=
User-Agent Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4
In-Reply-To <c32da847-b415-4ba3-954c-e51ee8cbf5ff@e35g2000yqc.googlegroups.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:5857

Show key headers only | View raw


On 05/31/11 12:20 PM, A Moose in Love wrote:
> I need to know in a simple way, how to create files, open them, write
> to them, save them, and close them.  I've googled and have come up
> with information that doesn't seem to work.  For example:
> // basic file operations
> #include<iostream>
> #include<fstream>
> using namespace std;
>
> int main () {
>    ofstream myfile;
>    myfile.open ("example.txt");
>    myfile<<  "Writing this to a file.\n";
>    myfile.close();
>    return 0;
> }
>
> This does not work.  I cannot find a file after running this little
> program called 'example.txt'.

The code is fine.  Are you sure you are looking in the correct place for 
the fine?

-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

File Manipulation? A Moose in Love <parkstreetbooboo@gmail.com> - 2011-05-30 17:20 -0700
  Re: File Manipulation? Ian Collins <ian-news@hotmail.com> - 2011-05-31 12:24 +1200
  Re: File Manipulation? Öö Tiib <ootiib@hot.ee> - 2011-05-30 18:15 -0700
    Re: File Manipulation? A Moose in Love <parkstreetbooboo@gmail.com> - 2011-05-30 19:22 -0700
      Re: File Manipulation? Ian Collins <ian-news@hotmail.com> - 2011-05-31 14:33 +1200
        Re: File Manipulation? John Smith <bit_bucket@gmx.com> - 2011-05-30 19:57 -0700
        Re: File Manipulation? Liberian Freighter <parkstreetbooboo@gmail.com> - 2011-05-31 06:41 -0700
      Re: File Manipulation? Geoff <geoff@invalid.invalid> - 2011-05-30 19:59 -0700
      Re: File Manipulation? Geoff <geoff@invalid.invalid> - 2011-05-30 20:25 -0700
      Re: File Manipulation? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-05-31 22:33 +0000
        Re: File Manipulation? Miles Bader <miles@gnu.org> - 2011-06-01 15:07 +0900
  Re: File Manipulation? Juha Nieminen <nospam@thanks.invalid> - 2011-05-31 08:25 +0000
  Re: File Manipulation? "Fred Zwarts \(KVI\)" <F.Zwarts@KVI.nl> - 2011-05-31 16:25 +0200

csiph-web