For simply programs, is function prototyping necessary?

What is the difference between:

1
2
3
4
5
6
7
8
9
10
11
void foo(); //function prototype

int main()
{
    //...
}

void foo()
{
  //implementation
}


and this:

1
2
3
4
5
6
7
8
9
10
void foo()
{
  //implementation
}

int main()
{
    //...
}


I know that function prototyping allows you to separate implementation from interface, but for small programs where that's not necessary, is there still a difference between putting the implementation after main function or implementing the function before main function?
Other than for formatting reasons I see no reason why one example would differ from the other. Granted I'm no expert, both will work the same.
Formatting, stylistic reasons. Logical order as well in that you want to structure things hierarchically, in that you see main being defined first, and called first. Function prototypes you can think of as a table of contents for the compiler.
Topic archived. No new replies allowed.