Call by Value, Call by Pointer, and Call by Reference Understanding how function parameters are passed in C++ is fundamental to mastering the language. Before diving into the types of parameter passing, it's essential to understand what it means to pass a parameter to a function. What is Parameter Passing? When a function is called in C++, you
Functions in C++ In C++, functions are the building blocks of reusable and modular code. Whether you're calculating the sum of numbers or managing a large application, functions help keep your code organized and maintainable. Let’s dive into the key concepts that define how functions work in C++. Defining a
Functions Nested Functions (Function Within a Function) Overview In this article, we will learn about functions calling other functions. Most of us have witnessed the journey of complaints for the serious mischievous behaviours in our school. The class monitor calls the subject teacher, then the subject teacher calls the class teacher, and then the class teacher calls
Functions Practice 2 Hello🙌, Today we will be doing more questions on function. Have you solved previous questions in the Functions 1 article?? If yes, then I think now we have a fair enough idea about how to approach problems using functions. Suggestion: I will highly recommend solving these questions without looking at
Functions Practice 1 Today, We will start practicing questions on function. We may have covered the concepts behind the questions in previous articles but our main aim in these questions will be to practice writing functions. As we know just doing the theory in a practical course is not a good idea. It&
Functions Standard Library Functions Introduction So, imagine you're cooking, and you have your recipe (those are like the functions you create and define). But sometimes, you use pre-made ingredients or tools (those are like the standard library functions). In C++, there are these pre-made functions that are already there for you to
Functions Why Do We Use Arguments and Return Type in a Function? Asking questions strengthen the concepts. So, Never hesitate to ask why behind something. ✌️ Use of arguments and return type in a function Using arguments and return values in a function allows us to create a piece of code that can be used independently. It's like you create your
Functions Local Variable What are Local Variables? Let us assume, you keep your savings in a secret box and lock it. Now, a person comes and tries to take money from that box. Obviously, he/she won't be able to do that. ( Don't tell me what if they break
Functions Return Statements Overview Today, we will learn about return statements. ✌️ In the previous articles, we discussed that functions take input and provide output (known as the return value). Until now, we've been using "void" as the return type for our functions, indicating that the functions don't
Functions Function Arguments in C++ Overview In this article, we will learn about how we can make our functions dynamic. If you have read the previous article "Introduction to function", you must have noticed that the function ( BirthdayGreeting( ) ) gives a static output. Function arguments are essential in programming because they provide a way
Functions in C++ Overview Suppose you go to a restaurant, they serve you main course, juices, ice cream, fruits, water, tissue everything in a single bowl. Would you like that?? I guess it's a strong "No". We want things to be organized i.e. every dish should be in