I have a question regarding this type of problem. There is a .txt file containing an unknown number of lines in a format like this:
Cityname(max 30 char)temperature(float)wind_speed(float)air_pressure(float).
Example of a line in a file: Paris-80.81010 where Paris is a city name, -8 is the temperature(float), 0.8(float) is the wind speed and 1010(float) is the air pressure.
It is needed to read all lines, and store each line in a structure with specific data types. The result needs to be a list of structs.
How can I read a line like this and store all the different data types properly without losing information? I have tried everything I could possibly think of, and I have no idea how to do this.