pointer initializatin - where to put the asterisk?
I am puzzled by a question lately, to wich I can't find an answer. What is the difference between the next pointer initialization methods:
I undestand, that the second one is the "standard" way of initializing a pointer, or at least that is how the tutorial on this website shows it, but what does the first one mean?
As I was searching the web for answers, I found another interesting example, where the pointer was initialized like this:
This was supposed to have some sort of special meaning, but I did not quite understand it, and I can't find the website now for further studying. I would be glad if someone could explain to me all these things about pointer initialization.
int * pointer_name=NULL
Big thanks in advance for everyone, reading this.
Well, here's an example...
Hm... I am trying to understand how does the next function works. It is from a SDL game programming tutorial.
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?
SDL_Surface *load_image(char filename)
Thanks for the answers so far!