I\'m writing a code for class where I take in input from a huge file (~850 lines) of data separated by commas. what I have so far is:
#include
You should convert string to float by extracting float from string stream. At present you are using string stream but you are extracting string from it instead of float.
Try something like this:
stringstream ss;
while ( getline( InputFile, DummyLine, ',' ) )
{
ss << DummyLine;
}
float dummyFloat;
while ( ss >> dummyFloat )
{
Data.push_back( dummyFloat );
}
Tray this:
//this can be cause exeptions
Entry[i].Elevation = atof (Data[((i*10) + 2)].c_str());
NOTE: include cstdlib