File input to array

hey everyone. im new to c++. This is my first semester. I'm stuck with some work. I'm supposed to import data from a file, search for the minimum and output the results to another file. Im able to do the coding but i need help in how to import the data to an array. The text file contains runner name, club, age and time for 500m, 1000m, 1500m, 2000m. The content is separated with ';'. This is confusing me alot. My lecturer is not the friendly type to explain stuff. He gets mad when we ask questions. Please help me guys
Last edited on
first off all, create an array of structure where the members will be name, club, age etc. Then use the fread() function to get the details from that file and finally from that array of structure search for the minimum and write it to the other file using fwrite() or fprintf() whatever you like.
Thanks for the answer!! but i have a small problem. We are only allowed to use the following header files :

#include <iostream>
#include <cstdlib>
#include <string>
#include <sstream>
#include <fstream>

any ideas with these header files?

Also our lecturer wants us to use stringstream. I tried searching, but i couldnt understand it. All i got was that you have to use getline(stream,variable,delimiter)
Last edited on
Topic archived. No new replies allowed.