In C, loadSurface
would be declared as simply
SDL_Surface *loadSurface(const char *path)
which means the call to SDL_LoadBMP
can be written as
SDL_Surface *loadedSurface = SDL_LoadBMP(path);
The details of what std::string
does and why .c_str()
is needed are not relevant if you are not interested in learning C++, and in this case are not relevant to the tutorial either.
2
solved C equivalent of C++’s double colons?