How do you limit the size of unsigned long? I am trying to istringstream data from a file and separate them by commas. For example, the first set is a date and the rest have decimal points.
#include <sstream>
#include <fstream>
usingnamespace std;
int main()
{
ifstream fin("myfile.txt")
string line;
stringstream iss;
double value;
while (fin.good())
{
getline(fin,line,',');
iss << line;
iss >> value;
//Do something with the value here (store it in a vector or array?).
}
return 0;
}
Stewbond, the date "19971002" is showing as 3435973836 when ofstream to a txt file. How would i do it so that it will show 19971002 again after doing w/e it is with the value?
Below is the code that i have: