C++ FunctionsLesson 25Free preview
C++ Functions
This lesson is part of C++ · All levels
Summary
This lesson discusses functions as a named code block that can be called over and over as needed. Using the functionality makes the program more orderly, reduces code repetition, and simplifies the process of debugging. You'll learn how to define a function, call it, and return a value through the statement return.
Key points
- A function is defined by the formula: type_return nama(parameter) {...}.
- A function is called by writing the name and its argument in parentheses.
- The void function does not return the value to the caller.
- Return terminates the function and returns the value if it exists.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.