by Dinesh Thakur Category: Functions

As we know that Private data of a Class can’t be Accessed with the help of an Object. Means if a Class Contains Some Data Members those are Private in nature then we cant Accessed those data Members with the help of an Object, from Outside the Class. So that if we want to do this. Then we must have to use the Friend Function. If a Function declared by using the Friend Keyword, then they can use the Private Data of a Class with the help of an Object.

 
by Dinesh Thakur Category: Functions

Whenever a function is invoked, a set of operations is performed which includes passing the control from the calling function to the called function, managing stack for arguments and return values, managing registers, etc. All these operations take much of compiler time and slow down the execution process. This overhead can be avoided by using macros in a program. However, macros are not considered as true functions, as they do not perform type checking. Another way to make function calls execute faster and also perform type checking is to make the function inline.



 
by Dinesh Thakur Category: Functions

As we know that when we call the Member Function from the Class then the Compiler will jump to that Function and after Executing all the Statements the Compiler will execute the Remaining Statements.

 
by Dinesh Thakur Category: Functions

 The function strcmp () is widely used in sorting of lists of names. Let S1 and S2 be the names of two strings. The function compares lexicographically (dictionary style) string S1 with string S2. It returns -1, 0, 1, respectively, if S1 is less than S2 , equal to S2, or greater than S2. Program illustrates its application.

 
by Dinesh Thakur Category: Functions

A function can also return values to the calling program. For such functions, the type of the value returned to the calling function should be mentioned before the function name in the definition. The general syntax of a function which returns value is:

 
by Dinesh Thakur Category: Functions

A function contains a set of statements which can be invoked from any part of the program. Function plays an important role whenever a sequence of instructions is to be repeated in a program. Thus it helps in reducing the size of the program. The function code is stored at only one place in the memory, though the function can be executed any number of times. Main () is also a function. Every program must contain the main () function. A function mayor may not return values to the calling function.

 
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

As the name suggest Override means to hide or Remove the Detail which is already Exists .Method or Function Overriding always Occur in the Inheritance, when a base Class and Derived Class both have a same name of Method. Then we will call that Method then this will Call the Method of Derived Class and Override the Body of Base Class Method.

 
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.

 

Page 7 of 18



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.