0

here is the code:

wint_t 
__woverflow (f, wch)
_IO_FILE *f;
wint_t wch;
{
if (f->_mode == 0)
    _IO_fwide (f, 1);
return _IO_OVERFLOW (f, wch);
}

But why are the variables between the name of the function and the start of body of the function? Im mean *f and wch. Are they locals or global?

2 Answers2

0

This is an old style C syntax.

Are they locals or global?

They are local variables. It is same as

wint_t __woverflow (_IO_FILE *f, wint_t wch)
{
    if (f->_mode == 0)
    _IO_fwide (f, 1);
    return _IO_OVERFLOW (f, wch);
}
Grzegorz Szpetkowski
  • 36,988
  • 6
  • 90
  • 137
haccks
  • 104,019
  • 25
  • 176
  • 264
0

This is K & R style function definition.

Your posted code is similar to:

wint_t __woverflow (_IO_FILE *f, wint_t wch)
{
    if (f->_mode == 0)
        _IO_fwide (f, 1);
    return _IO_OVERFLOW (f, wch);
}

They are local to the function.

ani627
  • 5,578
  • 8
  • 39
  • 45