Hm... I am trying to understand how does the next function works. It is from a SDL game programming tutorial.
Code:
SDL_Surface *load_image(char filename[])
{
SDL_Surface* loadedImage=NULL;
SDL_Surface* optimizedImage=NULL;
loadedImage=SDL_LoadBMP(filename);
if(loadedImage!=NULL)
{
optimizedImage=SDL_DisplayFormat(loadedImage);
SDL_FreeSurface(loadedImage);
}
return optimizedImage;
}
As you can see, both methods are used in this function definition - but why? Is this really just a matter of style or does it make some crucial difference if I put the asterisk to another position? As far as I tested, the program runs and compiles fine, when I play around with the asterisks, so - can it be, that the author of the tutorial wasn't consistent enough?
Thanks for the answers so far!