problem solved
problem solved
Last edited by magic101; 02-07-2009 at 08:14 PM. Reason: none
Blue: The -64 bit evens out, doesn't it?Code:value = (toupper(buff)-64)-(toupper(key_array[i])-64); if(value < 0){ value = value * (-1); }
Red: I think this should be "value = 26 + value" or some such.
Assuming this was right, you could do "value = -value", which is much simpler to follow and the compiler won't make an unnecessary multiply if it isn't clued onto what you are doing (most compilers probably DO understand that you are simply changing the sign, but why write more complicated code and ALLOW the compiler the oppurtinity of making more complex code?).
--
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
thank you soooooooooo much
26+ value worked
thanks again