I am studying by myself and I am so confused as to what these two codes does and how it works? Could someone explain this to me step by step in very simple terms?
I'm sorry for the inconvenience, the book is just a little too chock-filled w/ confusing language for me to really get it. Thank you in advance!
Well, the first one is a constructor for the class DonationList, the second one is a member function. I'm still a noob so that's all I can tell you with confidence and still make sense.
It's also hard to help you without knowing what you already know about them. Do you know about for loops? arrays? pointers?
I know about for loops, arrays and pointers yeah! Well. At the basic level, anyway.
I think all the meshing of them all is super confusing to me that's all. I'm just not sure what this program does . It's mostly with the second half though, like (*(arrPtr[index) < *minElem) , I have no clue what the heck that does.
* is the dereference operator. So for example *(arrPtr[index]) gets the value that is stored in the address pointed to by the pointer at the index 'index' of the array arrPtr.
So like in the code above, cout << ptr will print the address but *ptr will print the value right?
So with *(arrPtr[index]) , is it like some...inception-nized pointer? A pointer within a pointer that retrieves the value of the index? Am I getting it or am I far off?