- #1
firekid123
- 8
- 0
I'm having trouble with printing out an error with cerr in the main function when there's an error in another function.
Example:
int main (){
//body
//statements
function (//parameters);
cerr<<"there's a problem"<<endl;
}
int function (//parameters){
if a < b
return -1;
else
return 0;
}
How would I get main to print out the error of the function?
Example:
int main (){
//body
//statements
function (//parameters);
cerr<<"there's a problem"<<endl;
}
int function (//parameters){
if a < b
return -1;
else
return 0;
}
How would I get main to print out the error of the function?