aboutsummaryrefslogtreecommitdiff
path: root/18_functions.zig
diff options
context:
space:
mode:
authorDave Gauer <dave@ratfactor.com>2021-01-22 17:42:03 -0500
committerDave Gauer <dave@ratfactor.com>2021-01-22 17:42:03 -0500
commit08ec029f20381580ebe76ad8bd3feca2e5cd262a (patch)
tree818a56fd583bab292fc61c5203762ec56a31f208 /18_functions.zig
parenta361b90a7562bcc5a62f863b42ae6a33aaa4b812 (diff)
downloadziglings-08ec029f20381580ebe76ad8bd3feca2e5cd262a.tar.gz
ziglings-08ec029f20381580ebe76ad8bd3feca2e5cd262a.tar.bz2
ziglings-08ec029f20381580ebe76ad8bd3feca2e5cd262a.tar.xz
ziglings-08ec029f20381580ebe76ad8bd3feca2e5cd262a.zip
Added ex 19,20 functions and pop quiz
Diffstat (limited to '18_functions.zig')
-rw-r--r--18_functions.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/18_functions.zig b/18_functions.zig
index ad16a13..ad97585 100644
--- a/18_functions.zig
+++ b/18_functions.zig
@@ -12,7 +12,11 @@ pub fn main() void {
//
// We're just missing a couple things here. One thing we're NOT missing is the
-// keyword 'pub', which is not needed here. Can you guess why?
+// keyword "pub", which is not needed here. Can you guess why?
+//
+// Functions need to specify the type of value they return. The main() function
+// above has a special return type "void", which means it returns nothing. This
+// function returns something. What might that be?
//
??? deepThought() ??? {
return 42; // Number courtesy Douglas Adams