1. ## Access violation reading location

I can't find anything wrong with my code. When i debug, this occurs.

Unhandled exception at 0x00fb74b1 in pacman.exe: 0xC0000005: Access violation reading location 0xfdfdfdfd.

Code:
```printf("Lowest F = %d, x:%d, y:%d", lowestf, openX[lowestf], openY[lowestf]);

The printf works fine, some integers are printed.

If i parse values like this there is no problem.
Code:
`ScanAdjacentNodes(5, 5);`
Code:
```int openX[550];
int openY[550];```
Code:
```void ScanAdjacentNodes(int x, int y) {

if(FREE(x+1, y)) {
f[index]=hscore(x+1, y);
openX[index]=x+1;
openY[index]=y;
index++;
} else {
closedX[j] = x+1;
closedY[j] = y;
j++;
}
if(FREE(x-1, y)) {
f[index]=hscore(x-1, y);
openX[index]=x-1;
openY[index]=y;
index++;
} else {
closedX[j] = x-1;
closedY[j] = y;
j++;
}
if(FREE(x, y+1)) {
f[index]=hscore(x, y+1);
openX[index]=x;
openY[index]=y+1;
index++;
} else {
closedX[j] = x;
closedY[j] = y+1;
j++;
}
if(FREE(x, y-1)) {
f[index]=hscore(x, y-1);
openX[index]=x;
openY[index]=y-1;
index++;
} else {
closedX[j] = x;
closedY[j] = y-1;
j++;
}

}```

2. What's the signature for ScanAdjacentNodes()? And the definition of the variables? You haven't given enough information.

3. IIRC, 0xfdfdfdfd means that you're trying to use a freed variable.