I need to instansiate an object and add it to an array. This is what I currently have in a method:
Row r;
rows[count] = r;
The problem here is r
is on the stack and being removed after the function exits. I quick fix is to make r
static but that is bad right? What should I do? (Sorry, complete C++ noob).
Edit: Removing the deconstructor for Row fixes the problem.