Just a quick one..

This is a discussion on Just a quick one.. within the C++ Programming forums, part of the General Programming Boards category; I tried searching through old posts with not alot of luck how do i write to the end of a ...

  1. #1
    Mmm. Purple.
    Join Date
    May 2002
    Posts
    154

    Just a quick one..

    I tried searching through old posts with not alot of luck how do i write to the end of a file using std::ofstream file1("data.dat"); so if i wrote 2 times it wouldnt overwrite the first 1

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    You can open it with append mode if that's what you want.

    http://www.cppreference.com/cppio_details.html#open
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    look up ios::app in your helpfiles or favorite textbook
    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. Do you know...
    By davejigsaw in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 11:33 AM
  2. recursive quick sort - stack overflow
    By Micko in forum C Programming
    Replies: 9
    Last Post: 01-01-2005, 05:51 PM
  3. Questions on basic Quick Sort
    By Weng in forum C++ Programming
    Replies: 4
    Last Post: 12-16-2003, 10:06 AM
  4. Quick Sort Help
    By NavyBlue in forum C Programming
    Replies: 1
    Last Post: 03-02-2003, 10:34 PM
  5. Replies: 0
    Last Post: 04-30-2002, 08:24 PM

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