使用代码:
int nsize;
int * buffer;
char TargetBuffer[4096];
const SIZE_T buffersize = (320*240) * sizeof(int);
buffer = (int *) malloc(bufferSize);
// fill buffer with data
nsize = 0;
while(nsize < buffersize)
{
// HERE after some loops i get Access Violation
memcpy(TargetBuffer, buffer + nsize, 4096);
// do stuff with TargetBuffer
nsize += 4096;
}
为什么我会收到访问冲突?我应该改变什么?