Wow, I did not mean to come across so hostile to you - sorry :(
I'll be specific:
Raezzor wrote: |
---|
Honestly, for me, I think the key to understanding pointers was understanding the whole pass by value/reference thing. Once you understand just how functions accept and return arguments you begin to see how pointers work a bit more. |
While pointers can be used a faction parameters, tha has little to do with the way they actually work. Pointers are just integral types that contain a memory address, along with soe syntactic sugar to make them easier to deal with. Their use with functions is based on convention, not language feature.
Raezzor wrote: |
---|
That, and understanding arrays more. |
Unfortunately in C++, arrays are something I tend to avoid, as they almost always degrade into pointers. The actual Array type such as
int arr[3];
isn't actually a pointer, though it is very often implicitly casted to one and treated as a pointer to a memory address on the stack. Dynamically allocated memory is not arrays, but can be very eaily (and almost always are) thought of as arrays. They're really just pointers to single variables and it just happens that due to the memory allocation process used, incrementing the pointer will allow it to point to yet another valid object in memory, but most people will make fun of you if you actually say that the pointer points to multiple objects. (they made fun of me, at least)
Raezzor wrote: |
---|
And just how to read long complicated names (ie, understanding the difference between const int * a, and int * const b.) |
More syntax and precedence than pointers themselves, but OK.
Again, I'm not trying to be rude, I'm just pointing out that the way you phrased everything you made it sound like you didn't truly understand pointers. I don't doubt your understanding, I just doubted your explanation. I've probably got some stuff wrong with the array stuff I said - I generally tend to avoid arrays for that reason; they're evil, and they're almost never treated as true arrays like in other languages (eg Java).