C++ array out of bound
stackoverflow.com