Skip to main content
gamedev.net
🔒 Locked

Using ofstream.

Started by KurtCPP 2 replies 250+ views
Original Post
KurtCPP
KurtCPP
Hi every-1. Id like to know how is that I often need to re-open() / close() the files I use if I want the stream to properly write in it?? What actually happens is that some sentences are written but not all so I have to re-put the open()/close couples. Does it come from if/else and so on statements?? Thanks for your guidance. :-) Prog, Hex & Rock''n''Roll : I don''t like the Prog but the Prog likes me. Some nice poetry to sweeten your spirit and relax a bit before programming
Prog, Games & Rock'n'Roll :I don't like the Prog but the Prog likes me.
Sneftel
Sneftel
Are you sure it''s not being written properly? perhaps you just need to sync your stream after writing.


How appropriate. You fight like a cow.
C-Junkie
C-Junkie
ofs << "test" << flush; // tadaa, written to disk.
KurtCPP
KurtCPP
Hi buddies.
Tx for your help. I''m gonna try. I think the flush gotta be the right answer; if it ever doesnt work I think I''ll flush my computer down the pan. (I have to admit this joke is as lame as britney spears sings lol).
Thank you guys.

Prog, Hex & Rock''n''Roll :
I don''t like the Prog but the Prog likes me.
Some nice poetry to sweeten your spirit and relax a bit before programming
Prog, Games & Rock'n'Roll :I don't like the Prog but the Prog likes me.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.