c++ reading from a file

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Randi
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 50
Joined: Sat Apr 24, 2010 1:32 pm
Location: Noobville

c++ reading from a file

Post by Randi »

I would like my program to read a file that has something like this:
name: test
health: 5
as you can see it has variables and what I would like to assign to them, should I go for a scripting language for this, or should I just use c++'s fstream?
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: c++ reading from a file

Post by Ginto8 »

well it's probly a good exercise for working with fstreams. Personally, I'd use a map and fscanf, but that's just me. I'd recommend that you try it in C++, if only for the practice it will provide.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
Post Reply