Question: I'm watching some video tutorials on C++ and i know you must define a function / class before it is used or called. But I like having my main() function at the top, and everything else below the main function. I know if i define a function below the main function I must declare it before it is used, but what about a class? What do I need to put above my main function to use my class below the main function.

```
#include <iostream>
using namespace std;

int main()
{
    ClassOne one;
    one.coolSaying();
    return 0;
}

class ClassOne
{
    public:
        void coolSaying()
        {
            cout << "Cool stuff yo!" << endl;
        }
};

```

I tried defining my class by placing this right before main():

```
class ClassOne;

```

but it doesn't work.

Answer: 
One scenario where the class definition after the main() function makes sense:

```
#include <iostream>
using namespace std;

void f();

int main()
{
    f();
    return 0;
}

class ClassOne
{
    public:
        void coolSaying()
        {
            cout << "Cool stuff yo!" << endl;
        }
};

void f()
{
    ClassOne one;
    one.coolSaying();
}

```
You cannot create an actual instance of the type (variable, value member) until the type is fully defined, as its size is not known. There is no way around that, but there is a lot you can already do with a pointer to an incomplete type.