Edit note on function prototypes.

This commit is contained in:
Levi Bostian 2013-09-20 22:13:10 -05:00
parent 7c559d57a8
commit 35909645f2

View File

@ -41,6 +41,10 @@ enum days {SUN = 1, MON, TUE, WED, THU, FRI, SAT};
void function_1();
void function_2();
// Must declare a 'function prototype' before main() when functions occur after
// your main() function.
int add_two_ints(int x1, int x2); // function prototype
// Your program's entry point is a function called
// main with an integer return type.
int main() {
@ -410,15 +414,6 @@ int add_two_ints(int x1, int x2)
return x1 + x2; // Use return to return a value
}
// Must declare a 'function prototype' before main() when creating functions
void getInt(char c); // function prototype
int main() { // main function
return 0;
}
void getInt(char w) { //parameter name does not need to match function prototype
;
}
//if function takes no parameters, do:
int getInt(void); for function prototype
// and for the function declaration: