Yes, the most common reason for console applications closing quickly is because you didn't give it any reason to remain open. Applications execute the instructions you give them and nothing more. If you don't tell it to wait for anything it will terminate very quickly. Usually you will get it to wait for user input at the end. Most (Windows-based) IDEs also have the ability to launch console applications and keep the window open at the end by automatically calling system("pause") just before the application terminates. Don't explicitly add this yourself though as system("pause") is bad, bad, bad.
On a side note: you should ask your professor why he wants you to use a 7 year old IDE just so that you can use GCC.