You shouldn't encounter any performance problems, however your code will become increasingly difficult to maintain if you don't structure it. For a trivial demo program it doesn't matter too much.
On a larger, more complex project the compile time would get longer and longer as all of the code has to be compiled every time. Ideally you should be breaking your functionality into multiple header and code files. Your best bet is to pick up a book on Object-Oriented Programming (OOP) to learn how to design object models and structure your code.
Sorry I can't recommend a specific book, as I have been coding a long time and haven't read that kind of book recently. Perhaps some of the other guys on here know of a good book.
Which programming language are you using? Is it C++?