Dev-c++ warn about functions declared with return types, but don't return anything....example:
the console appears:Code:#include <iostream> using std::cout; int greatest(int, int); int main() { cout << greatest(1,2); return 0; //this line added in after "The Brains" post //...unintentionally forgot to add this line } int greatest(int a, int b) { //typically, i would not code a function like this //...it's just for example int biggest; if(a < b) biggest = b; else biggest = a; //return biggest; //it seems that i have mistakenly commented out the return statement. }
as if the program was within an infinite loop.Code:_
1. is there a good reason why there is no warning or error?
2. is there any compiler variables (in dev-c++) i can set that will throw an error?



LinkBack URL
About LinkBacks



)