I have my struct
Expand|Select|Wrap|Line Numbers
- struct month
- {
- float totalRain, highTemp, lowTemp, averageTemp;
- };
and this is my array
Expand|Select|Wrap|Line Numbers
- struct month fullYear[12];
Expand|Select|Wrap|Line Numbers
- month jan, feb, mar, april, may, june, jul, aug, sept, oct, nov, dec;
each of the struct variables will be placed in the array respectively, but I am unsure how to read the information from the file putting them in their rightfull place.
The values in the input file will be separated by blanks. A sample single line in the input file might be:
20.1 78.2 40.1
How would I go about placing 20.1 into jan.totalRain in my array?
I hope I explained myself clearly, If not just let me know.
Thank you all for your help in advance.