I'm new to C++ (I'm most comfortable with node.js and Java, but have done some Python before) and am working through understanding pointers. The following example generates a runtime error when compiled with debug symbols.
#include <iostream>
void main(){
int number = 0;
int * numberPtr = &number;
* numberPtr = 1;
std::cout << number;
delete numberPtr;
}
And the error message:
Debug Assertion Failed!
Program: C:\path\to\executable\main.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Expression: _BLOCK-TYPE_IS_VALID(pHead->nBlockUse)
FWIW, I've gotten the same error when I've compiled with both VS 2008 and 2013.