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,004
  • 4
  • 86
  • 132
haccks
  • 100,941
  • 24
  • 163
  • 252
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,221
  • 8
  • 38
  • 44