> function definition in c ~ Online tutorial

function definition in c

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

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: