Hi there,
I'm in the process of moving some code into Visual C++ 2008, the code works fine when compiled with Mingw however crashes when compiled with VC++:
s_cell **cell;
*cell = (s_cell *) malloc(sizeof(s_cell) * MAP_X);
for(int loop = 0; loop < MAP_X; loop++)
{
cell[loop] = (s_cell *) malloc(sizeof(s_cell) * MAP_Y);
}
It fails with the following error:
Run-Time Check Failure #3 - The variable 'cell' is being used without being initialized.
and breaks at the *cell = (s_cell *)... line.
I tried replacing the array with a vector however this means a lot of other code needs to be changed and while I have tried nothing appears to happen, I'm sure it's something I'm overlooking in frustration.
Hopefully someone can give me some guidance here.