this question has answer here:
i reading through gnu c library - date-time - data & functions , came across function definition:
int timeval_subtract (result, x, y) struct timeval *result, *x, *y; { //do stuff return result; }
i have never come across argument passing before. -there not type variables within parenthesis (). -ok type "struct timeval" comes later, using same variable names?
is above entirely equivalent
int struct_timeval(struct timeval *result, struct timeval *x, struct timeval *y){ //do stuff }
or not?
it old style of function declaration. uses identifier list in declaration.
this kind of declaration not equivalent function prototypes. prototype, function arguments converted type of parameters if assignment without prototype default argument promotion occurs.
Comments
Post a Comment