Link to home
Start Free TrialLog in
Avatar of JHannah
JHannah

asked on

Input of numerical data from a file

I am currently writing a program to statistically test data I have done
                         the main body of the program but am having trouble setting up an
                         input so that I can just read from any disk full of numerical data into a
                         vector.
                         Ideally all the data I have will come as doubles seperated in the file by
                         a blank space in between each reading I need the program to take
                         them 51 at a time and place them in a vector so that the stats test
                         can be carried out upon them.
                         I am fairly certain I need to use an IFStream command but am unsure
                         as to how exactly to get precisely the outcome I want.
                         Any advice will be gladly accepted
Avatar of gvg
gvg

Do you want to know how to read from the file or process the numbers after you have read the from file?

Are you using MFC? ( Makes things easier )

to convert strings to a float or double value you can use the function

double atof( const char *string );

Gunnar Valur



ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial