3 ms·
It's a holdover from Fortran (and probably from before that). Whereas modern day we would define functions as int foo(int i, int j) {...} in Fortran you w
by 30thElement 13y ago
It's a holdover from Fortran (and probably from before that). Whereas modern day we would define functions as
int foo(int i, int j) {...}
in Fortran you would do (! is comment)
function foo(i, j)
integer :: foo !return type
integer :: i
integer :: j
!body goes here
Early C stuck to that style, so you would just put the names of the variables in the declaration, and then before the body give them types. The reason only argv is mentioned in that example is that C assumes a variable is an int if not declared otherwise, so there's no reason to put "int argc" like "int argv[]".