1.

Why Does The Function Arguments Are Called As Signatures?

Answer»

The arguments distinguish functions with the same NAME (functional polymorphism). The name alone does not necessarily identify a unique function. However, the name and its arguments (SIGNATURES) will uniquely identify a function.

In real life we see suppose, in CLASS there are two guys with same name, but they can be easily identified by their signatures. The same CONCEPT is applied here.

ex:

class person

{

public:

char getsex();

void setsex(char);

void setsex(int);

};

In the above example we see that there is a function setsex

() with same name but with DIFFERENT signature.

The arguments distinguish functions with the same name (functional polymorphism). The name alone does not necessarily identify a unique function. However, the name and its arguments (signatures) will uniquely identify a function.

In real life we see suppose, in class there are two guys with same name, but they can be easily identified by their signatures. The same concept is applied here.

ex:

class person

{

public:

char getsex();

void setsex(char);

void setsex(int);

};

In the above example we see that there is a function setsex

() with same name but with different signature.



Discussion

No Comment Found