Page 1 of 1

c++ reading from a file

Posted: Sat Aug 14, 2010 9:59 pm
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?

Re: c++ reading from a file

Posted: Sat Aug 14, 2010 11:20 pm
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.