-
Notifications
You must be signed in to change notification settings - Fork 0
Functions
Bean Pringles edited this page Dec 11, 2025
·
2 revisions
Functions are declared with the keyword "fn"
There are two types, returning and non-returning.
Returning functions have a "-> " at the end, so they look like:
fn testFunc() -> int {}
These functions are compiled into an "int" function in C, looking like:
int testFunc() {}Returning functions do not have a "->" and are compiled down to "void"
fn testFunc() {}
These functions in C are:
void testFunc() {}