Friday, 1 July 2011

C# Function Signature

C# Function Signature

Hello Friends,

This the article related Function Signature..

During a function call, a C# compiler needs to resolve the name of the function .The signature of a function is defined by :

1)The number of parameters. Consider the following example:

void AddNumber(int);
void AddNumber(int float);
In the preceding code, there are two functions beacuse the number of parameters id different.

2)The data types od parameters.Consider the following example:
void Display(int);
void Display(char);
In preceding code, the two functions are differenet beacuse the data type of their parameters different.

3)The sequence of parameters.Consider the following example:
void Display(int,char);
void Display(char,int);
In the preceding code, the two functions are different because their parameters are specified in a different order.
Very Importent Note:

The return type is NOT a part of a function's signature.therefore, the following two declarations can't occur in the same class:
void display();
char display();

No comments:

Post a Comment