Before I had a good idea how to use pointers, I was wondering - first,
how to use them. And second, of what value would they be.
Now that I have at least a pretty good idea of how to use them, I am
still wondering of what real value are they?
I'll admit - its pretty sexy to be able to assign values indirectly,
but what I'm trying to figue out is why it is any better than assigning
the values directly.
Declare a pointer, point it at some element of an array, dereference
it. Whew - seems like a lot of work when you can just: myArray[5]
=6.
Any comments would be appreciated. As you can tell, I am new to C++ -
but I love it!
how to use them. And second, of what value would they be.
Now that I have at least a pretty good idea of how to use them, I am
still wondering of what real value are they?
I'll admit - its pretty sexy to be able to assign values indirectly,
but what I'm trying to figue out is why it is any better than assigning
the values directly.
Declare a pointer, point it at some element of an array, dereference
it. Whew - seems like a lot of work when you can just: myArray[5]
=6.
Any comments would be appreciated. As you can tell, I am new to C++ -
but I love it!
Comment