Thread: force the programm to write data

  1. #1
    Registered User
    Join Date
    May 2008

    force the programm to write data


    | am running a scientic simulation of an agent-based model. The programm writes data to the hard disk using "Outputfile << data;". I would like to use the data with excell or gretl, whil the programm is running. How can I make the programm writing everything that is queed?


    /Thanks here to everybody, who send replies to my thread "Running a console progrum faster". I used gprof and rewrite the crucial code its now 10x faster and better.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    You can close the file and re-open it again next time you need to write data.

    Or you can use ostream::flush() to force the data to be written out.

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help to write a C programm
    By lustro in forum C Programming
    Replies: 2
    Last Post: 05-10-2009, 01:40 PM
  2. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  3. How to write image data to binary PGM file format(P5)?
    By tommy_chai in forum C Programming
    Replies: 6
    Last Post: 11-03-2007, 10:52 PM
  4. Some humour...
    By Stan100 in forum A Brief History of
    Replies: 8
    Last Post: 11-06-2003, 10:25 PM
  5. C Programming Question
    By TK in forum A Brief History of
    Replies: 13
    Last Post: 07-04-2002, 07:11 PM