#include <iostream> using namespace std; bool isEven(int num) { if(!(num )) return true; return false; } int main() { if(isEven(4)) cout << "4 is even\n"; if(isEven(3)) cout << "this won't display"; return 0; }
4 is even
7.2.function prototype | ||||
7.2.1. | Use a function prototype to enforce strong type checking | |||
7.2.2. | Use a function's definition as its prototype, appears before main | |||
7.2.3. | Returning a pointer from function |