Logo 
Search:

OOAD FAQ

Submit Interview FAQ
Home » Interview FAQ » OOADRSS Feeds

Why does the function arguments are called as "signatures"?

  Shared By: Adah Miller    Date: Jan 25    Category: OOAD    Views: 162

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.

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: