you cant because you are reading the file into an int. you will need to read it into a string and then test to see if has a decimal or not.
NathanOliver
Veteran Poster
1,084 posts since Apr 2009
Reputation Points: 215
Solved Threads: 189
do you know of the string class?
NathanOliver
Veteran Poster
1,084 posts since Apr 2009
Reputation Points: 215
Solved Threads: 189
to test if it has a decimal you can do something like
size_t spot;
string test = "123.456789";
spot = test.find_first_of(".",0)
if (spot == std::string::npos)
cout << "there is a decimal";
NathanOliver
Veteran Poster
1,084 posts since Apr 2009
Reputation Points: 215
Solved Threads: 189