dimanche 28 juin 2015

Creating [][] operator for class in c++

I am making a Pentago game for someone, and I wanted to write a good code, so I decided to use operator overloading.

We have 2 classes; first one is Block class (which represents every single block of the board) and the second one is Set class (which represents a 3*3 table of blocks). Now I want to use Set as a 2d array so I can use set[foo][foo]. Can you help me to make an operator like this?

Aucun commentaire:

Enregistrer un commentaire