Going for an interview and worried? Do not panic. I have brought something useful for you. In most technical interviews candidates are asked to solve programming questions. You are given a short period of time for solving them. Most of the time they will not ask you to solve a lengthy questions having a large […]
Category: C++ Tips
1. The complexity of linear search algorithm is a. O(n) b. O(log n) c. O(n2) d. O(n log n)
The call by reference method of passing arguments to a function copies the reference of an argument into the formal parameter. Inside the function, the reference is used to access the actual argument used in the call. This means that changes made to the parameter affect the passed argument.
The call by pointer method of passing arguments to a function copies the address of an argument into the formal parameter. Inside the function, the address is used to access the actual argument used in the call. This means that changes made to the parameter affect the passed argument.
Using call by value method, only the copies of actual arguments is passed to the called function. By default, C++ uses call by value to pass arguments . The call by value method of passing arguments to a function copies the actual value of an argument into the formal parameter of the function.
A function is a self defined block of statements that performs specific tasks for some time. A function is an assignment or a task that must be performed to complement the other part(s) of a program. Every C or C++ program has at least one function which is main(), you can define your own functions as […]