99% of the time if you get a difference between release and debug mode you forgot to zero a variable and assume it is. Turn the warning levels up to full and you should get a warning saying "use of uninitialized variable". Usually it is something like this
int Bad (int someval){
int i;
if (someval > 0){
i = 1;
}
if (i == 0) return (1);
return (0);
}
In debug mode all local variables are zeroed automatically. That simply doesn't happen in release mode the variables will start at whatever rubbish was in the stack at the position it was allocated. In the above code the behaviour of "bad" is totally predictable in debug mode as "i" will always start at 0. In release mode you have no idea what is going to happen as "i" could start at any value and the return is purely chance based. Look carefully at the code, now try compiling it and tell me if you get a warning :-)
In vino veritas