Functions and recursion: Difference between revisions

wikademia>Miklcct
m corrected some terms
wikademia>Eme
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
This lesson will have to do with using functions and recursion to improve readability and efficiency of your code. This lesson assumes you have a general grasp of C++ syntax. Other than that, I will explain everything as well as I can.
This lesson will have to do with using functions and recursion to improve readability and efficiency of your code. This lesson assumes you have a general grasp of C++ syntax. Other than that, I will explain everything as well as I can.
 
{{?}}
==Functions==
==Functions==
Simply put a function is a segment of code that is isolated from the main code segment. A function is ''called'' from a section of code. When the function's code has been executed, it ''returns'' to the calling code. The general form of a function is:
Simply put a function is a segment of code that is isolated from the main code segment. A function is ''called'' from a section of code. When the function's code has been executed, it ''returns'' to the calling code. The general form of a function is: