You always have to have a main function in C++; it's the starting point for your program.