I'm about one week into Jumping Into C++, an e-book I purchased from this website. While I have struggled with the information on pointers, re-reading the sections a few times, it started making a little sense. However, today I ran in to a bit of code in the book that left me scratching my head.
This function is from page 151. And my question about is:Code:int *growArray (int* p_values, int *size) { *size *= 2; int *p_new_values = new int[ *size ]; for ( int i = 0; i < *size; ++i ) { p_new_values[ i ] = p_values[ i ]; } delete [] p_values; return p_new_values; }
What, exactly, does *= mean? I don't get it. And there's nothing in the book that explains it to me. This is not easy, wrapping my mind around pointers and references. Commenting the code would have made all of this easier to grasp. I'm new at this, but one of the first things I learned was a good programmer comments his code so that the next person looking at it has some idea of what's going on. And since this is a book of instruction, I believe commenting the code examples throughout would have made the book much more user friendly.
Anyways, will someone please help me with *=
Thanks,
Landslyde