Element of user defined function:
1.function definition
2.function call
3.function declaration
Defintion of function
A function definition ,also known as function implememtation shall include the following elements
1.function name
2.function type
3.list of parameter
4.local variable declaration
5.function statement
6.a return type
Syntax
Function type function_type(parameter list)
{
Local variable declaration;
Executable statement1;
Executable statement2;
Return statement;
}
Example:
void add(int a,int b)
{
int c;
return 0;
}
for above the statement
void - return type
add -function name
int a,int b -parameter
1.function definition
2.function call
3.function declaration
Defintion of function
A function definition ,also known as function implememtation shall include the following elements
1.function name
2.function type
3.list of parameter
4.local variable declaration
5.function statement
6.a return type
Syntax
Function type function_type(parameter list)
{
Local variable declaration;
Executable statement1;
Executable statement2;
Return statement;
}
Example:
void add(int a,int b)
{
int c;
return 0;
}
for above the statement
void - return type
add -function name
int a,int b -parameter
0 comments:
Post a Comment