Your teacher taught you that main() returns void? Get another teacher. The main() function returns an int.

I can break your class easily with a two-line main() program.


int main()
{
...