-
Help
I cant figure out how to use the atoi function....
So Maybe its not wht I need.
How can I do this
Code:
int number;
char string1[20];
ifstream fin("file.dat");
fin >> string1;
if(number > string1) dofunction();
See, string1 contains pure numbers, but it must be a char to get the info from file, right?
:confused:
-
if(number > atoi(string1)) dofunction();
-
-
Why not read in an integer?
Code:
int number;
int number_2;
ifstream fin("file.dat");
fin >> number_2;
if(number > number_2) dofunction();
-
oh.... Wow, I feel stupid.... Thank You!