1
0
Fork 0
mirror of https://github.com/ratfactor/ziglings synced 2024-05-05 01:56:03 +02:00

Update 018_functions.zig

This commit is contained in:
Dave Gauer 2021-08-28 10:25:03 -04:00 committed by GitHub
parent a7ba7306f6
commit 71fbe3a07b
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,18 +1,15 @@
//
// Functions! We've already created lots of functions called "main()". Now let's
// Functions! We've already created lots of functions called 'main()'. Now let's
// do something different:
//
// fn foo(n: u8) u8 {
// return n + 1;
// }
//
// The foo() function above takes a number "n" and returns a number that is
// The foo() function above takes a number 'n' and returns a number that is
// larger by one.
//
// If your function doesn't take any parameters and doesn't return anything,
// it would be defined like main():
//
// fn foo() void { }
// Note the input parameter 'n' and return types are both u8.
//
const std = @import("std");