Can I use an if function to test if the function returns a certain value? If so could I make a function in my class or would I have to test it in the main function?
Can I use an if function to test if the function returns a certain value
Surely you can, though "if" is not a function but a control structure
1 2 3 4 5 6 7
int sumDimension(int a, int b, int c) {
// ...
}
if (sumDimension(length, width, height) <= 150 && weight <= 80) {
// ...
}
If you mean this. However in your case it would be better to calculate sum of dimensions in separate variable before all these ifs - cal this variable "size" for example - and then use if (size <= 150) etc.