Tuesday 16 December 2014

Functions related to C++

The following rules are necessary while implementing functions.
1. Function Prototype
2. Function Definition
3. Function Calling
2.Function Definition:
We need to infirm the compiler that the name of function (identifier) along with arguments, return type.
The compiler checks that weather the identifier is matched or not. And then checks the arguments matching.

After identifying proper function name and function arguments, The corresponding calling function communicate with called function.
 Implicit assignment: when we are going to use function overloading( more than one function with same name but different number of arguments and different data types) method, if we pass float data type instead of int data type, Then the compiler adjusts that float value to int type for real time applications, it gives runtime bugs in ‘C’ language.
    
      C is not allowed to pass float instead of int. if we want to pass such type of arguments, we need to use type casting. The compatible data types need to use in C. But C++ language is flexible towards type casting. Automatically it adjusts data type based on functional arguments