To caps or not to caps that is the question?

Levi Pearson levi at cold.org
Tue Dec 18 09:36:10 MST 2007


Steve <smorrey at gmail.com> writes:
>
> Here are the relevant lines.
>      for(; counter < length; counter++)
>      {
>           coin = RandomNumber(0,100);
>           letter = (letter == oldletter) ? ((coin <= 60) ?
> PickChar(vowels) : PickChar(consonants)) : letter;
>           letter = (counter == 0) ? toupper(letter) : letter;
>           name += letter;
>           oldletter = letter;
>      }
>      return(name);

I agree with Nicholas, I think you're not initializing counter to 0.
The optimization probably changes the stack layout a bit, which could
leave a different bit of garbage in counter's stack slot depending on
the optimization level.  It could also assign it to a register.  Who
knows?  You could always look at the asm.

                --Levi



More information about the PLUG mailing list