Dear all,
I would like to use a fonction to read the value (int) within a text file.
The text file contains just one line with an Int value (0/1).
So, to read the text file, I use this:
1 2 3 4 5 6 7 8
|
ifstream fichier(valGPIO);
if(fichier)
{
string ligne;
getline(fichier, ligne);
cout << ligne << endl;
}
|
And there is no problem. The output is correct, for example I got on console a value = 1 or 0.
My problem is how can I get this value (0/1)from the console to use it within a program ?
In fact, this value will be useful to activate another function.
For example, if the output is 0, do nothing, if 1 then do smart thing ;-)
Thank you for your help and support
Regards,