Why don't you use any of the is functions? isalnum would give you any letter or digit, or isprint would tell you if it was a printable character. Most of those checks are going to be lookup tables anyway. isprint is going to give you pretty much every valid character that would be used, and should be a fast way to see if the resulting check's suggested encoding character was valid or not. It seems like your if check you use a lot could be replaced with:I'm also not sure about your rule where you can't be entering nonpunctuation. I guess because we're assuming that the encrypted text doesn't start a line with a period? Was that a stipulation by the OP?Code://if((ch < 'A') || (ch>90 && ch<97)) { if( isprint( ch ) ) // or isalnum .. if you're assuming no punctuation/whitespace to start
Quzah.