Here I have an excerpt of code from an SDL tutorial online.
The URL for this is(look about a quarter down the page):
http://cone3d.gamedev.net/cgi-bin/in...ls/gfxsdl/tut2
The actual code is this:
I don't understand why the '&' is needed before dest on the last line. I thought &'s were used when making references and assigning pointers, i.eCode:void DrawIMG(SDL_Surface *img, int x, int y) {
SDL_Rect dest;
dest.x = x;
dest.y = y;
SDL_BlitSurface(img, NULL, screen, &dest);
}
int *x = &age; //a pointer
int& rx = age; // a reference
dest is not a pointer or reference, it is just an object of the struct SDL_Rect (which means rectangle by the way).
If you can shed some light into my heathenistic brain I'll probaly sdfj;acibucparcrap
