I need to do calculations inside an object which changes the values of its members. To same memory, I want to write over the objects in the next step of the algorithm and do not create new objects. How can I reinitialize the object members?
I wasn't sure the above definition of add_data adds the data to the right foo. I will fix it as you suggest.
But, there are about hundreds of members in the class and i feel lazy to write them all and set them all to zero. Isn't there a better way, like deconstructing and constructing them again?