C don't have runtime checking of array bouds so if You write with incorrect index, You can overwrite anything else...

So at first be sure You use only valid indexes! And second: be sure You use the same type (UInt8) for all writes.

Hynek Sladky


[EMAIL PROTECTED] wrote:
Hello,

I hope that someone can help me with this.  I currently have 2 global
variables.  Both are 2-dimensional arrays declared as follows:

static UInt8   Board[9][9];
static UInt8   Answer[9][9];

For some reason, if I change an element in the first array, it will
corrupt values in the second array. But, not always the same elements. It varies from time-to-time. It's almost as if these 2 arrays are sharing
the same memory space.

Any idea why this is happening?  Has anyone seen this behavior before?  Is
there something I can do to isolate these 2 arrays?

Thanks,
-Bobby



--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to