Hi everyone. I have a bit confusion about vector.
here is my 2 structs <global>and in the main have vector declared.
file name is"report.txt"
Have file with meteo readings,like
•
the meteorologist’s name on duty that day (a string of up to 12 characters)
• hours of sunshine (double)
• rainfall in millimeters (double)
• midday temperature in degrees (double)
looks like 12 1 2009 tommy 3.4 12.5 9.5
...... so on for a full month.
The question is how do i copy file contents into vector for a use.
Here what i have :
struct DATE{
int day;
int month;
int year;
};
struct onDutyRecords{
string name;
double sunshine;
double rainfall;
double midTemp;
DATE date;
};
int _tmain(int argc, _TCHAR* argv[])
{
vector<onDutyRecords>records;
return 0;
}
aluhnev 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.