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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -