Original Post
I''m working on a simple encryption system for a shareware key setup....
Look at this code:
btw - before anyone asks why I don''t just use divide and remainder operators, it''s because I''m going to expand it to a more complex system, assuming I can get this simple setup to work first
char convertName(int *mult, int num)
{
int m=0;
while (num>25)
{
num-=26;
m++;
}
num+=(int)''A'';
*mult=m;
return (char)num;
}
It simply takes a character and returns another character in encrypted form. It first reduces it to the range of 0-25 and then adds ''A'' to it so that the resultant character sits between A and Z. I store mult so that I can store that as the multipler for decryption.
The problem is, when it receives the character ''ü'' the resulting character returned is ''=''.
If you look at your ascii table, you''ll see that ''='' is actually before ''A'' in the table, so how am I getting an equals sign int he output!?
What have I missed here? I must be missing something (probably something simple) but I can''t see it for the life of me