If I just do it: Ex1:
#include int main() { //try to call doSomething function doSomething(); } void doSomething(
Because the compiler hasn't seen doSomething before it's used.
Either you must prototype it, or define it first, so that the compiler knows how to analyze the usage of it.