C++: Access violation writing location

Your problem is here: You’re not creating an instance of ElemAlg, so you’re calling a member function on an uninitialized pointer. Because the member function you are calling isn’t virtual the compiler won’t have to do any runtime lookup, which is why the call goes to GetQuiz. However, the this pointer will be garbage (as ea is uninitialized), so the moment … Read more