C++Introduction to C++Learn C++

Learn About Parameters Passed by Reference in Functions

In the functions that we created in previous posts, their parameters have always been passed by value. This means that, when we call a function, what is passed to the function are the values of these parameters on that moment of the call. Variables are copied into the variables represented by the function parameters. Let’s remember an example, #include int add (int a, int b) { return…
Read more
C++C++11C++14C++17Introduction to C++Learn C++Templates

Learn About C++ Functions

Functions, also known as Procedures or Sub-Programs, Sub-Algorithms, allow to structure programs in segments of code to perform tasks. A Function is a group of statements that has function a name and can be called with parameters to operate, functions can be called from some point of the program or they can call themselves recursively. All C++ programs have a main() function which holds the…
Read more
C++C++11C++14C++17Introduction to C++Learn C++

Discover Function Overloading in C++

Do you want to learn how to overload a function ? What is Function Overloading ? What does overloaded function means ? How we can use Function Overloading in C++ ? How we can use multiple parameter types in our functions ? Here we go,Function Overloading is used to operate with the same function by defining it with different variable types. By using Function Overloading, a function can be used…
Read more
C++Introduction to C++Learn C++

Discover Goto and Labels in C++

The goto statement is used to jump to a label that provides an unconditional jump from the goto to a labeled statement in the same function. We can also do the same loops as the same in for() while() loops by using goto statement. Instead of goto we mostly use for(), while(), do-while() statements or functions, classes, because they are faster and better than using goto. Rarely sometimes we…
Read more