Function standards in C programming

There are two types of function parameter standard:
1. ANSI standard
In this standard function definition is written as
int calculate(int a, int b){
    int c;
    c=a+b;
    return c;
}
This standerd is also called as modern style.
2. K and K standard
int calculate(a, b)
int a,b;
{
    int c;
    c=a+b;
    return c;
}
This standard is also called as old style.You should also known this style if you want to read old c code.
Examples:
void main(){
    int i=kkstandard(5,5,5.0f,'5');
    printf("%d",i);
    getch();
}
int kkstandard (a,b,f,c)
int a,b;
char c;
float f;{
    int x=a+b+c+f;
    return x;
}
Output: 68

No comments: