Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Pointers to Structs?

Name: Anonymous 2010-07-19 16:29

Hey guys, I'm having some trouble with pointers in C++

Lets say we are setting up an SDL surface

SDL_Surface *screen;

Why do we make it a pointer? I looked in the header file for SDL_Video and SDL_Surface is a struct! So that means we are pointing to a struct, but then how are we able to do this?

screen = SDL_SetVideoMode(...);

So yeah my question is basically, how does pointing to a struct work?

Name: Anonymous 2010-07-19 16:49

Maybe you shouldn't be trying to use a library like SDL without first understanding how your language works.
Also, learn C before going anywhere near Sepples.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List