c / beginner
Snippet
Functions Without Parameters
A function can be defined without parameters. It performs a task or returns a value without needing external input.
snippet.c
c
1
int getCode() { return 404; }
Breakdown
1
int getCode()
Defines a function that returns an integer and accepts no arguments.
2
return 404;
Sends the value 404 back to the part of the program that called the function.