Creating a File

This is a discussion on Creating a File within the C++ Programming forums, part of the General Programming Boards category; Hello Everyone; I am new to the world of C++ and I know some file I/O coding but I wanted ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    10

    Talking Creating a File

    Hello Everyone;

    I am new to the world of C++ and I know some file I/O coding but I wanted to know if there was a way for your program to create a file if the requested file does not exist.
    "If at first you do succeed try not to look astonished!" -- anon

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    When you save, a file will be created if one doesn't exist.
    If a file already exists it will be overwritten (unless specifying APPEND, which continues at the end of it).
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    Read the FAQ board or search the board, it's a common question!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM

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