CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2001
    Location
    Quebec, Canada
    Posts
    4

    Storing Variables...

    hello,

    I'm making a game, and was wondering how to make 'save files' to store some variables.
    thanks for any help/code.


    --yellowTIGER--

  2. #2
    Join Date
    May 2001
    Location
    Russia
    Posts
    200

    Re: Storing Variables...

    That type of your data?
    String or bin?

    Andy Tower

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Storing Variables...

    You can use ini file.

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  4. #4
    Join Date
    Jan 2001
    Posts
    165

    Re: Storing Variables...

    You'll need to consider whether or not you want some or all of these variables accessible to the user. If you will be storing information like lives left and score you will not want to write this data as mere text in a file else the user will be able to edit this.

    You can always just open a file for output in binary and store bytes of data rather than the actual ascii codes. You can have a data-block say 1024 bytes or however many you need. Then you just write the bytes (maybe even use some sort of offset to help encode the data) in a certain order so that you can read it back in. Perhaps use a check byte as well to validate the data.

    Hope this makes sense.

    -K


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured