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?
c++ reading from a file
Moderator: Coders of Rage
- Ginto8
- 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
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.