Concept
How are void functions defined in C?
ComputerScienceOne / Void Functions
"18.1.2. Void Functions\n\nThe keyword void can be used in C to indicate a function does not return a value, in which case it is called a “void function.” Though it is not necessary, it is still good practice to include a return statement.\n\n//prototype:\n\nvoid printCopyright();\n\n//definition:\n\nvoid printCopyright() {\n\nprintf(\"(c) Bourke 2015\n\n\");\n\nreturn;\n\n}\n\nIn the example above, we’ve also illustrated how to define a function that has no inputs. Some sources may include an explicit void keyword as a parameter to indicate the function takes no parameters as in void printCopyright(void); ."
Related Ideas
- What is a void method in Java?ComputerScienceOne · Void Methods
- How is a C function prototype turned into a function definition?ComputerScienceOne · Declaration: Prototypes
- How are functions defined and declared in modern C?ComputerScienceOne · Declaration: Prototypes
- What information does a C function prototype specify?ComputerScienceOne · Declaration: Prototypes
- How do header and source files organize functions in C?ComputerScienceOne · Calling Functions
- How do you call a function in C?ComputerScienceOne · Calling Functions
- How do you call functions in C?ComputerScienceOne · Organizing Functions
- What capabilities and constraints do functions have in C?ComputerScienceOne · Declaration: Prototypes