Skip to main content

Posts

Showing posts from December, 2012

Function Overloading

You overload a function name f by declaring more than one function with the name f in the same scope. The declarations of f must differ from each other by the types and/or the number of arguments in the argument list. When you call an overloaded function named f, the correct function is selected by comparing the argument list of the function call with the parameter list of each of the overloaded candidate functions with the name f. A candidate function is a function that can be called based on the context of the call of the overloaded function name. Consider a function print, which displays an int. As shown in the following example, you can overload the function print to display other types, for example, double and char*. You can have three functions with the same name, each performing a similar operation on a different data type: #include <iostream> using namespace std; void print(int i) {   cout << " Here is int " << i << endl; } void pri

Data Independence

The ability to modify  a scheme definition in one level without affecting a scheme definition  of high level is called Data Independence.