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 doubles 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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -