开发者

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?

Thanks


std::ifstream can certainly read strings. Have you remembered to include <string> though?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜