File i/o & int arrays

This is a discussion on File i/o & int arrays within the C++ Programming forums, part of the General Programming Boards category; Hi, I don't know why but I'm having problems reading in an array of integars from a file setup like ...

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    14

    File i/o & int arrays

    Hi, I don't know why but I'm having problems reading in an array of integars from a file setup like this:

    "Users"
    {
    "Sect" "0"
    "Clan" "0"
    "Potence" "5"
    "Celerity" "5"
    "Strength" "5"
    "Dexterity" "5"
    "Stamina" "5"
    "Fireamrs" "5"
    "Money" "6850"
    "XP" "43"
    }

    It is a configuration file and I need to have all the numbers in that list so I can change them etc. I'm trying to read them in, and allow them to be changed, someone hook me up with the storing of the variable into an array of integers please.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Have you tried anything? We tend not to help people who just want a handout.
    My best code is written with the delete key.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  4. newbie needs help with code
    By compudude86 in forum C Programming
    Replies: 6
    Last Post: 07-23-2006, 08:54 PM
  5. easy if you know how to use functions...
    By Unregistered in forum C Programming
    Replies: 7
    Last Post: 01-31-2002, 06:34 AM

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