If you want to read a file, use std::ifstream amp(amplifierGPIO);
1 2 3 4 5 6 7 8 9 10
{
std::ifstream amp(amplifierGPIO);
if (amp.is_open())
{
int data; // or perhaps a string?
amp >> data;
// use data
}
}
// C++ streams close automatically when destroyed