by Dinesh Thakur Category: Functions

In addition to call by value, a function can also be called by reference. C++ provides two ways of passing arguments as reference to a function. The arguments can be passed either as a reference type or as a pointer type.

 
by Dinesh Thakur Category: Functions

When a Function can call itself again and Again or When a Function call itself until a Condition is not to be False. When a function definition includes a call to itself, it is referred to as a recursive function and the process is known as recursion or circular definition. In this a function call itself repeatedly. In the Recursion we just have to make a One Time call and the will automatically call itself Again and Again.

 
by Dinesh Thakur Category: Functions

In some cases when a similar action is to be performed on different types of data, different functions having different names are to be defined for all types of data. This makes the program very complex as the programmer must keep a track of the names of all the functions defined in the program. To prevent such situations, C++ allows the functions to be overloaded.

 
by Dinesh Thakur Category: Functions

When a function is called by value, the values of the actual arguments are copied into the formal arguments and the function works with these copied values. As a result, any changes made to the copied value in the called function do not affect the value of the actual argument in the calling function.

 
by Dinesh Thakur Category: Functions

strcpy () : If Sl and S2 are the names of two strings, the function call strcpy (S1, S2) copies

the contents of S2 including null character on to Sl. If S2 is smaller than Sl, there is no problem, however, if S2 is bigger than Sl the operation will eat into adjacent memory.

 
by Dinesh Thakur Category: Functions

In order to use a function in a program, the function must be first defined somewhere in a program. A function definition contains the code that specifies the actions to be performed. The syntax for defining a function is

 
by Dinesh Thakur Category: Functions

A recursive function is a function which invokes itself repeatedly. In this case function name appears within the function. Two examples of recursive function are given as follows:

 
by Dinesh Thakur Category: Functions

Like C, C++ enables to pass arguments to the main () function also. These arguments are passed by typing them after the program name on the command line. Hence, these arguments are known as command line arguments. Command line arguments help in providing data to the program.

 

Page 2 of 3



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles