Hey guys so I have learned the basics of C++ and have decided to start making small 2d games as a hobby.I have decided to go with SDL2 as it is under zlib license.So I am trying to develop a sample game engine(2d) and have written a small game engine containing 2 source files,one header n other the main body.
Here's my hearder file named game.h:-
When i run the code,it gives the normal messages as it should(I have included messages to check if everything works or not) till the one in void render().That's when the messages stop and it prints "Segmentation Fault".
Can anyone explain to me where I am wrong?
And if you guys can then pls correct my code wherever Im wrong,pls.
Thank you!!!
Here, you dereference sr which points to some random place in memory. Don't do that. Immediatly after that you dereference dr which suffers from the same problem.
(I don't see what this has to do with Unix/Linux programming.)