What is this strange function definition syntax in C? -


i've seen few function definitions while playing gnu bison:

static value ripper_pos(self)     value self; {     //code here } 

why type of self outside of parenthesis? valid c?

those old k&r style function parameter declarations, declaring types of parameters separately:

int func(a, b, c)    int a;    int b;    int c; {   return + b + c; } 

this same more modern way declare function parameters:

int func(int a, int b, int c) {   return + b + c; } 

the "new style" declarations universally preferred.


Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -