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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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