"I usually put all my code in one file "
Stopped reading after that, are you insane?
Stopped reading after that, are you insane?
In that stuation, reducing complexity is the correct thing to do. You can achieve this by stuffing all your code in one fine, not checking if malloc failed, etc.
When you decide the concept works, THEN you go back and do it properly.
This sort of "prototyping for speed" is discussed much better here: https://gameprogrammingpatterns.com/architecture-performance...