Question: What's the difference between:

```
void function();

int main()
{......}

void function()
{......}

```

vs

```
void function()
{.......}

int main();

```

It seems odd to declare a function before main then define it after main when you could just declare and define it before main. Is it for aesthetic purposes? My teacher writes functions like the first example.

Answer: 
It's just for code organization purposes ("aesthetics", I guess). Without forward declarations you'd need to write every function before it's used, but you may want to write the bodies of a function in a different order for organizational purposes.

Using forward declarations also allows you to give a list of the functions defined in a file at the very top, without having to dig down through the implementations.

Forward declarations would also be necessary in the case of mutually recursive functions. Consider this (silly) example:

```
bool is_odd(int);  // neccesary

bool is_even(int x) {
  if (x == 0) {
    return true;
  } else {
    return is_odd(x - 1);
  }
}

bool is_odd(int x) {
  return is_even(x - 1);
}

```
Note I mean to make this answer supplementary, others have already given good answers to this questions. 

Note that knowing how to forward declare things in C++ becomes very important. Once you begin using header files it basically becomes mandatory. Header files will allow you to build a prototype of functions and classes/structs then define them in a corresponding .cpp file. This is a very important organizational feature of C++. 

```
// MyClass.h

class MyClass
{
public:
    MyClass(int x);
    void printInt();
private:
    int myInt;
};

// MyClass.cpp

MyClass::MyClass(int x)
{
    MyClass::myInt = x;
}

void MyClass::printInt()
{
    std::cout << MyClass::myInt;
}

```

Doing things this way makes it so you're not completely bound to make a huge hodgepodge of code. Especially if you're writing real programs that will have a considerably large amount of source code. 

So while in the question you asked forward declaring is really just more of a preference, later on it really won't be a choice.