views:

48

answers:

1

Dear all,
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

+1  A: 

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

MSalters
Yes, I added string and my code works now. Thanks alot
aryan