implicit explicit

This is a discussion on implicit explicit within the C Programming forums, part of the General Programming Boards category; Whats the differance between calling a function explicitly and implicitly I know explicit means fully defined and implicit means partially ...

implicit explicit

Whats the differance between calling a function explicitly and implicitly I know explicit means fully defined and implicit means partially defined/implied but what would the different calls look like,
also if a function does'nt return a value is it best to declare its return type to be void or just leave it blank.

> implicit means partially defined/implied but what would the different calls look like
Implicit declaration just means the compiler 'guesses' what the prototype for the function should have been, based on your first use of the function.

So if you said
foo ( 2 );

The compiler would guess that the prototype should have been
void foo ( int );

This may or may not be actually correct, and even if it is, you should prototype the function.

> also if a function does'nt return a value is it best to declare its return type to be void or just leave it blank
Make it void

Just cuz you are programming in c doesn't mean that the definitions of the words implicit and explicit have changed. When I say "you never do anything" I calling you lazy implicitly, whereas saying "you're lazy" is explicit. The compiler needs to know what a function is before you use it. Otherwise it will put how you used it into context. However, any compiler that just lets you implictly declare functions is one that needs to be thrown in the garbage. It is the programmers responsibility to tell the compiler what to do, not the compiler's responsibility to guess what the programmer was trying to do.