can anyone help me with reading txt file into a data structure?

it shows me a warning in this line:


fscanf (myfile, "%d %s %s %s", clothes[c].quant, clothes[c].type, clothes[c].brand, clothes[c].descrip);

warning: cannot pass objects of non-POD type 'struct std::string' through '...'; call will abort at runtime.

plus, my whole program does not run at all.
you should use the c++ version of the filestream: http://cplusplus.com/doc/tutorial/files/
Topic archived. No new replies allowed.