#include <Windows.h>
#include <iostream>
using namespace std;
int main(void)
{
unsigned char* pFoo = new unsigned char[1000];
pFoo = (unsigned char*)VirtualAlloc(NULL, 1000, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
VirtualFree(pFoo, 0, MEM_RELEASE);
delete[] pFoo;
cin.ignore();
cin.get();
return 0;
}
这对我来说崩溃了
delete[] pFoo;
我知道这是因为 VirtualAlloc 而崩溃,但我不知道如何解决这个问题......