Hello
I am unsure of the correct way to make this function below(multiply) stop if a condition is true?
The reason why is because of the function type, its not an int, string, void etc, I am unsure how to stop a function whos type is the class name?
Do I use...
return;
return -1;
return EXIT_SUCCESS;
return FAIL;
#include <iostream>
using namespace std;
class set {
public:
set multiply(const set &other) const;
private:
int num;
};
set set::multiply(const set &other) const
{
if (num == 0) {
cout << "Function 'multiply' stopped \n";
return -1; // is this the correct way to stop/end this function or should I use return; or return EXIT_SUCCESS;
}
}