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

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -