summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--c.html.markdown13
1 files changed, 4 insertions, 9 deletions
diff --git a/c.html.markdown b/c.html.markdown
index 9745ed9a..df6cd036 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -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: