Hello, im trying to port some vb code into C++, and ive run into a snag.
I took the following code in vb:
Code:
For Index = 0 To 71
T1 = (T1 + TempCard(TempCard(Index) Mod 17) + TempCard(Index)) And &HFF&
TempCard(Index) = T1
Next Index
And Rewrote it in C++ to get:
Code:
for (unsigned int n = 0; n < 72; n++){
T1 = (T1 + TempCard[TempCard[n] % 17] + TempCard[n]) & 0xFF;
TempCard[n] = T1;
}
I cant find anything wrong with the C++ code, however its returning different values in TempCard and T1 then the vb app. They are the same values going into the loop, but different coming out. Also, TempCard[72] is an integer and T1 is also an integer. Any help would be appreciated.
Mike
Edit: typo