In C++, I know that if I need to read something from a file, I can do this:
int x;
ifstream ifs("data.txt");
ifs >> x;
However, is there a function that simply returns the value of whatever I'm feeding in? For example, if I had this:
bool arr[100];
int x;
ifstream ifs("data.txt");
ifs >> x;
arr[x] = true;
Would I be able to do away with the ifs >> x part? Is it possible to have something like
arr[function_of_something(ifs,...)] = true;