-1

I have just seen C code in the following manner:

void foo(par1, par2)
  int par1;
  short par2;
{
  // some code ...
}

What is this called, if you add code between parameter list and function body? Did not find it by googling. What is allowed to do there and what not?

Michael
  • 696
  • 7
  • 27

1 Answers1

4

I assume that you mean to be

void foo(par1, par2)
  int par1;
  short par2;
{
   // some code ...
}  

If this is the snippet then it comes from K&R C and it can be found in older C books and programs. C89 and C99 support this style so that older programs will still compile.

haccks
  • 100,941
  • 24
  • 163
  • 252