c++ - Access violation on a private array inside a class -
for part borrowed code rasterteks dx11 tutorial modified lightly or own use , taste. getting read access violation while using below inputclass set keystates. #include "inputclass.h" inputclass::inputclass() { } inputclass::inputclass(const inputclass& other) { } inputclass::~inputclass() { } void inputclass::initialize() { // initialize keys being released , not pressed. (int = 0; i<256; i++) { keystate[i] = false; } return; } void inputclass::keydown(unsigned int input) { // if key pressed save state in key array. keystate[input] = true; return; } void inputclass::keyup(unsigned int input) { // if key released clear state in key array. keystate[input] = false; return; } bool inputclass::iskeydown(unsigned int input) { // return state key in (pressed/not pressed). return keystate[input]; } below main callback loop, 1 registered windowclass: lresult callback wndproc(hwnd hwnd, uint message, wpar