What does this mean?

Apr 10, 2014 at 9:22am
Hey guys! I wanted to start programming a simple 2D "Hello World" with SDL but I don't understand one this : "*". What does the symbol * mean? It's used in so many places when programming graphics and stuff, and nowhere does anyone say what it is and what it means. Is it so easy and I'm just stupid to have missed it? Many thanks! :)

 
 SDL_Window* window = NULL;
Last edited on Apr 10, 2014 at 9:24am
Apr 10, 2014 at 9:27am
It means that window is a pointer to a SDL_Window.

So the next step for you is to learn about pointers ;)
Apr 10, 2014 at 9:40am
OHH I see. Thanks! I thought it was a pointer, but I wasn't sure becaus I didn't learn em yet haha. Ty again! Time to learn them! XD
Apr 10, 2014 at 9:43am
Apr 10, 2014 at 10:03am
Thanks!
Apr 10, 2014 at 10:09am
Try watching this:

http://www.3dbuzz.com/training/view/c-plus-plus-complete/intermediate-techniques/introduction-to-pointers


Why do they keep saying * is the reference and & is the dereference operator? Isn't it the other way around?
Apr 10, 2014 at 11:11am
That's a sign of tutorials that are of poor quality. I wouldn't recommend using that tutorial, but the one on this site. And instead of the NULL macro you should be using nullptr.
Last edited on Apr 10, 2014 at 11:12am
Topic archived. No new replies allowed.