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 do you call a function in C?ComputerScienceOne · Calling Functions
- How do you use methods defined in another Java class?ComputerScienceOne · Void Methods
- How do you call functions in C?ComputerScienceOne · Organizing Functions
- How do header and source files organize functions in C?ComputerScienceOne · Calling Functions