From af7711af0d634c0b3e8a9d81905c7f847cfb1c2b Mon Sep 17 00:00:00 2001
From: Lucas Rufkahr
Basics
@@ -335,7 +338,16 @@
This means that if a is greater than b, assign x with 1. If a is not greater than b, assign x with 0. The ternary operator however needs the values in the if and else part to be of the same type. If they are not, the program will fail to compile.
x = (a > b) ? 1 : 0;
+ A function is a wrapper to easily reuse code and improve readability of your program. The function signature contains the return type, the identifier of the function, and the parameters that the function requires. The function contains statements within the curly braces. Finally, the function returns a value which has a type indicated in the function signature.
+
+ type name (parameters) {...}
+ ... +