Want to learn C by doing projects?

This site on Github has lots of interesting projects that will help you improve your C programming ability.
Whether it’s a chess engine, a sudoku solver, space invaders clone, tic-tac-toe (noughts and crosses for us Brits!), Othello, program a text adventure plus a lot of non games stuff as well.
I’ve added this to the C code Links page.
Or do you fancy learning how to write your own virtual Machine in C? Authors Justin Meiners and Ryan Pendleton have crafted a 14 part tutorial that will teach you how to write a VM that can run assembly language programs.
You can’t return anything from a constructor. One way is to use exceptions but those can bring their own issues. Google’s C++ guidelines actually stipulate no exceptions and I’ve heard it from others as well that they prefer not to use them. Some people avoid it by having a mostly empty constructor and then an init() method to do the real initialisation and return a success/fail state.
This is a screenshot of it as it stands and yes those asteroids are moving! It looks identical to the C version; the only difference is the code, not the appearance.
I got my Pi 4 a week ago and have been doing experiments on it with my Asteroids game. If I disable the line of code that kills the player ship in the DestroyObject() function and just add a return after case tPlayer: and uncomment the code that adds Asteroids when you press A then I can have lots of asteroids on screen. Also set the MAXASTEROIDS #define to 128.
I was interested in seeing what frame rate I got out of it and how much it warmed the PI.
As always bugs are the fault of the creator and mea culpa (my bad!). I can trace this back to my conversion from the Windows source to the Ubuntu version. This line in LoadMask
I made the mistake of starting by trying to convert the final version of Asteroid; all 2,200 lines of C into C++.