Thread: Read variables and stuff from a text file

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    7

    Read variables and stuff from a text file

    I am making an Rpg, and I want my players to be able to save their game to a text file. I don't want you to write the entire program jsut give me the general idea.

    An example of the text is the *.txt file is

    ------------------------------------------------------------------------------------
    [Player Names]
    Player1 = Chris Jones
    Player2 = Ed Jones
    ------------------------------------------------------------------------------------

    How do I get the program to read the line and make the char Player1 = Chris Jones.

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    you'll need to use strings, not chars.

    What is your question?

    How to read in a file? It should be in the faq..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 03:25 AM
  2. unable to read double A[0] and A[1] when n=1
    By sweetarg in forum C Programming
    Replies: 2
    Last Post: 10-25-2005, 12:35 PM
  3. Reading text file and structuring it..
    By Killroy in forum C Programming
    Replies: 20
    Last Post: 11-19-2004, 08:36 AM
  4. Results for the Encryption Contest -- June 23, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 07-07-2002, 08:04 AM
  5. Reading a file to variables
    By BigBadApe in forum C++ Programming
    Replies: 2
    Last Post: 06-29-2002, 04:34 PM