How do you make save files?

This is a discussion on How do you make save files? within the C++ Programming forums, part of the General Programming Boards category; How do I make save files for a game? How to store and recall variables to a file the user ...

  1. #1
    His posts are far and few Esparno's Avatar
    Join Date
    Mar 2002
    Posts
    100

    How do you make save files?

    How do I make save files for a game? How to store and recall variables to a file the user would name is basically what im asking. PS this is going to be a text based RPG if you need to know.
    Signature is optional, I didnt opt for one.

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    591
    The first thing you need to do is to search the board for things that have to do with file handling.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    This is a topic that has been addressed frequently on this board by looking at the results of a search done using the search button on the top right hand side of the screen.

    The first decision you need to make is what to store. Do you wish to store a users name, scores, place in program at time of closure, whatever. Then you need to decide how you are going to store the information--unrelated data variables and data variables enclosed in a struct/class are two common methods. Last you need to decide which style of file handling you wish to use. Choices here include C style FILE * with associated functions like fwrite(), fread(), fscanf(), fprintf(), etc.---OR---C++ style streams such as fstreams which can be used to both read and write files or dediciated streams like ofstream to write to file and ifstream to read from file.

    So...think about what you want to do. Review some of the posts already available on the board. Review appropriate sections on file handling in your favorite textbook/tutorial. Give a go, Joe. And if you have specific questions post them with pertinent code and/or error messages.

    Go for it!

  4. #4
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561
    It's in the tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I can't make bmp image files show up in an SDL window
    By Lucas89 in forum Game Programming
    Replies: 5
    Last Post: 05-25-2009, 01:04 PM
  2. Make Files
    By shipyard in forum C Programming
    Replies: 6
    Last Post: 03-13-2005, 11:43 AM
  3. How To Make The Program Installed In Program Files Folder?
    By javacvb in forum Windows Programming
    Replies: 4
    Last Post: 11-05-2003, 04:33 PM
  4. Major glitch losing source files with MSVC++ and WinXP
    By JasonD in forum C++ Programming
    Replies: 10
    Last Post: 08-14-2003, 12:15 PM
  5. creating make files
    By Unregistered in forum Linux Programming
    Replies: 4
    Last Post: 09-22-2001, 01:58 AM

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