Hi
I was programming a somewhat simple game with my friend (on bc5, using directx), when a strange error beset us.
We have 2 ''major'' classes in the game, the CGame (game logic) class, and the CEngine (game graphics) class.
in the CGame class, we also hold as member variables, a couple of vars (of the same type) that act as the game AI of the same class (CGameAI).
One of CGameAI ''s functions is:
void Learn(double *input,double *desired_output);
where input and desired_output are actually arrays. (The user of CGameAI allocates the memory, and takes care of
deletes)
Now, the CGameAI class is a fully debugged class, that I already worked with a couple of times, and
1. it worked
2. it had no bugs (!) (at least, not apparent ones

The problem is, that under this implementation, it has the following bug:
CGame holds as member variables a couple of double arrays, to send to CGameAI::Learn. These arrays are filled by some function in the game loop.
But when in Learn, the desired_output array is accessed, the game crashes for no apparent reason.
My friend suggested that its something to do with the stack, but I am not quite sure of what that means

.
So both of us are quite puzzled, befuddled, and whatnot. But mostly annoyed- this thing is the ''final barrier'' before the game works.
If any of you have any applicable advice, please reply, it will be greatly appreciated.
Lorg.