I'm a c++ student and we made a class file and now we have to split the file into a header file, a main file, and the file itself, in my case it would be asteroids.cpp, main.cpp, and asteroids.h
Getting to the point, can someone show me how to split my code into the three files and how/why the files are split up (specifically the two cpp files)?
A header file will have just the declarations of all class methods and members. The corresponding cpp file will have the actual definition of all these.