Please use code tags when posting code.

In addition to GCDEF's solution, you can also declare your functions before main and define them after main, as such


#include <iostream>

void foo();...