Reading files multi-data-type (c++)
I want to read from one file that has several kinds of data-types. I utilize ifstream (C++ language) but it can't read strings.
In fact, I have written a code that has too many options and input parameters. Now, I want to read these parameters开发者_如何学运维 and (bool) options from an input file, then I can run my program by edition of input file and running makefile. I think I want something like this:
...
Number of Groups = 3 Name of Groups = David Jack Jill ...Now, my code must allocate memory for "Groups" object. Group should have 3 member that their names are David, Jack and Jill.
Can anyone help me, please? Thanksstd::ifstream
can certainly read strings. Have you remembered to include <string>
though?
精彩评论