c - Function without any return type -
i know there 2 types of functions: void
, ones return (int, double, etc). if function declared without return statements? considered void
function? example,
myfunction(int value){ ....... }
a function declared without return type considered returning int
. ancient rule going original k&r c, left in language backward compatibility.
integer promotions , conversion of float
arguments double
s done functions without prior definition or forward declaration same reason - backward compatibility old code.
it needless relying on these rules new development bad practice. 1 should declare return type explicitly, , forward-declare or define functions before calling them.
Comments
Post a Comment