Functions and recursion: Difference between revisions
wikademia>Wikademia m 14 revisions |
wikademia>Eme m moved Beta:Functions and recursion to Functions and recursion over redirect |
||
| (3 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: | ||