Can I not call fstream to write to two files sequentially?

This is a discussion on Can I not call fstream to write to two files sequentially? within the C++ Programming forums, part of the General Programming Boards category; I opened a stream using this very function fstream index("c:\windows\desktop\index.htm", ios: ut); I then close it using index.close(); I then ...

  1. #1
    tigeress
    Guest

    Can I not call fstream to write to two files sequentially?

    I opened a stream using this very function

    fstream index("c:\\windows\\desktop\\index.htm", ios:ut);

    I then close it using

    index.close();

    I then open a new stream called multimedia

    fstream multimedia("c:\\windows\\desktop\\multimedia.htm", ios:ut);

    After writing to the file through the stream both times, the index stream works but multimedia does not, what could be causing this?

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    post more code. all seems well with that!
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Indexing files to write to?
    By shadow1515 in forum C Programming
    Replies: 2
    Last Post: 06-10-2008, 09:17 AM
  2. Some humour...
    By Stan100 in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 11-06-2003, 09:25 PM
  3. Assembly example
    By Lynux-Penguin in forum C Programming
    Replies: 6
    Last Post: 04-24-2002, 07:45 PM
  4. Write and use data stored in data files...
    By alex6852 in forum C++ Programming
    Replies: 2
    Last Post: 11-01-2001, 12:45 PM
  5. deleting files not in fstream?
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 10-09-2001, 01:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21