Error in Resize() for a Button Class
I am trying to make a class to help me create buttons that can be used to read mouse Input during a Console Input event. I was able to create the Button and Image_button Classes and the default functions (Construction, Printing, Clicking), worked just fine. Link : https://github.com/kinshuk-h/Image_Button I then tried to define Setter Functions for these classes to change the position (via Move()) or the size (via Resize()) of the buttons on the screen. The Resize functions for the Image_Buttons class, works fine for a single object, but if I try to define multiple objects, say I1 and I2, and call I1.Resize(), the program returns an error code : 0xC0000005 (Memory Access Violation). If I call I2.Resize() instead, the error code is not returned. I found that the program did reach the end of the function in both the cases, but only in case 2 the program ends successfully. Please help me solve this error. Is this due to Lock()? If yes, why does the program terminate successfully when the Button being resized is the last one?