Computer Chess Club Archives


Search

Terms

Messages

Subject: Microsoft follies (visual C/C++ 6.0) Answer found. (cough, cough) :)

Author: David Dory

Date: 02:05:22 02/08/04


My run time errors, where simple variable assignments would work in the first
for loop, and blatantly fail in the next, have been found and bug sprayed.

It seems, perhaps, a certain coder didn't notice a global variable had (cough,
cough), also been inserted as a parameter to the misbehaving function.

The first for loop, incremented the loop counter, and worked fine:
for(i = 1; i <= movenum; i++) {
   //first time thru, i == 1, here
   some_array[i] accessed and tested here
}

The second for loop, the loop counter was totally "hidden", and couldn't be
assigned a simple value, even.

for(i = 1; i <= movenum; i++) {
   //first time thru, i == 8596128, (total crap value)
   some_array[i] access causes fatal exception, naturally
}

So Bill and Co. can rest easy, I guess.

For me, this was just a run time error, with no warnings from the compiler.

David



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.