vendredi 28 octobre 2016

c++ how to put a pointer to a pointer in dvc

I'm new to c++ (java programmer) and I am working on a homework assignment for an intro course. The purpose is "Constructors, Dynamic Memory Allocation and Overloading Operators" That being said, I'm really stuck on one of the specifics.

I'm creating 2 classes Color, and ColorBox. It was specified in the instruction that the member variables in ColorBox are int width, int height and Color** data. My understanding is that data holds reference to a 2D array of Color objects...

My question is: How do I set some type of empty or basic value for data in the DVC? And does anybody have a link for a decent write up on this kind of pointer? I've found generic write ups on arrays and pointers but I'm still having trouble wrapping my head around this.

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire