tags:

views:

128

answers:

1

What are the difference between a K&R function declarartion and an ANSI function declaration?

+12  A: 

K&R syntax is obsolete, you can skip it unless you have to maintain very old code.

// K&R syntax
int foo(a, p) 
    int a; 
    char *p; 
{ 
    return 0; 
}

// ANSI syntax
int foo(int a, char *p) 
{ 
    return 0; 
}
Wizard
caf
@caf No, I was using a nonstandard extension to the language :-)
Wizard