I would like to get some help, i am getting this error while running application
Exception thrown at 0x0029B23D in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0xFDFDFDFD. If there is a handler for this exception, the program may be safely continued.
I think the problem is accessing non-paged memory region
Here is my code
int ** create_tab(int size)
{
int ** tab = new int *[size];
for (int i = 0; i < size; i++)
{
tab[i] = new int[size];
}
return tab;
}
int definition(int direction, int px, int py, int tab)
{
switch (tab[&py][&px]) {
case 1:
tab[&py][&px] = 0;
direction = direction - 1;
break;
case 0:
tab[&py][&px] = 1;
direction = direction + 1;
break;
}
return direction;
}
int main()
{
int px = 0;
int py = 0;
int direction = 0;
int size = 0;
int steps = 0;
int steps_done = 0;
for (int steps_done = 0;steps_done < steps;steps_done++)
{
system("cls");
turningaround(direction);
moves(direction, px, py);
looping_tab(px, py, size);
definition(direction, px, py, ** tab);
printing(size, ** tab);
}
The problem comes from definition function, the program starts but when i try to continue it just appears again and again.