Contenido del Curso
C++ Intermediate | Mobile-Friendly
C++ Intermediate | Mobile-Friendly
Declaration vs Definition | Prototype
Functions in C++ consist of 2 elements:
- Declaration: the function's name with parameters (if they exist).
- Definition: the function’s body.
The function declaration is also called the function’s prototype. The code body (the definition) can be defined separately. It’s a good rule to write before the main function prototypes of other functions to understand how many functions we have and which arguments it passes. After the main function, you should specify the function’s definitions:
It doesn’t affect your code if you specify prototypes or not. We won’t do this in further chapters since our code is still pretty simple and doesn’t need strict structurization.
¡Gracias por tus comentarios!