[Solved] members of class being overwritten when new instance created c++/cli


So, it turns out that the problem was with declaring the array static in the class. Apparently what I actually wanted was to declare the variable but create it in the initialization function. I had tried this earlier, but the compiler choked and I thought that there was a problem with doing it this way. But, once I was determined that this was the solution I was able to make it work. Static means that the memory is the same for all instances of the class which is a convenient way to share data common to all instances of a class. I realized that I could use this for another array in the same class that would no longer need to be read in each time.

solved members of class being overwritten when new instance created c++/cli