Hello everyone
I am new to the forum
I have a question. I created a method foo(ifstream &myfile)
and works only if executed ones. In a loop or consequtively calls make the cerr call
int foo( ifstream &infile){
if (!infile) {
cerr << "Unable to open file ";
return -2;
// exit(1); // call system to stop
} else{
while(infile>>x){
do something
}
}
return matrix[row][column];
}