0
Array of structs C++
How do you write a function that asks a user for the input file name(txt file), and then read all data from that file and the data have to be stored into an array of structs.
4 Respuestas
+ 2
I think than the better way to resolve your problem is understand what you cannot coding.. Where you have a problem? You know how read from console input? How read a file?
+ 2
Start with reading here http://www.cplusplus.com/doc/tutorial/files/
It explain how work with files in c++.
Insert data inside an array of struct, involve in knowing how many struct you need (eg this info would be inside the file to read) then read all data following a logic used for create the file.
+ 2
I suggest to read the tutorial linked on my previous comment so you will find more easy solve your problem and you will learn something
0
how do you read a file and store it into the array of structs?