Read data from file and put into vector
Hi everyone. I'm new to this board and am just starting to learn C++. I'm having difficulties with part of a problem I'm trying to solve. I need to read data from a file, which contains integers representing date and time, and insert the data into a vector.
My data file for appointments are layed out like so, representing month day year hour minute:
05 16 2012 09 00
08 30 2011 10 30
My elementary vector so far looks like this:
vector<Appointment*> fileData;
fileData[0] = new Appointment(read_month_data_from_file, read_day_data_from_file, read_year_data_from_file, read_hour_data_from_file, read_minute_data_from_file);
I've added the read_ parts to represent where the data needs to be transfered into.
Any help would be greatly appreciated. Thanks for the time and help in advance.