Reassigning a pointers reference in C++ -


This is driving me crazy and I think I have tried to do almost everything.

  SDL_Surface * cell :: image = NULL; // somewhere in the main cell: loadsforfaces (cell :: image, "image.bmp"); Zero cell: loadsforfaces (SDL_surfus * surf, four * filename) {if (surf == faucet) {SDL_surf * temp; SDL_Surface ** temp2 = & amp; Surf; Temp = SDL_LoadBMP (filename); If (temp == NULL) printf ("image can not be loaded \ n"); Other printf ("image loads \ n"); Surf = SDL_DisplayFormat (temp); // * surf = * SDL_DisplayFormat (temp); // signature Uint32 colorkey = SDL_MapRGB (surf-> format, 0, 0, 0); SDL_SetColorKey (Surf, SDL_SRCCOLORKEY | SDL_RLEACCEL, Kolkata); SDL_FreeSurface (Temporary); }   

Both image and load are static. The image always remains, regardless of whether it has been assigned to it or the program ends in a default, such as in the commentary row.

Surf from context to allow "post-text" itemsprop = "text" >

pass surf input cell :: image .

  Zero Room: Loadsforces (SDL_surfus & surf, four * filename) {// ^ ...    

Comments