View Single Post
Old Sep 26th, 2005, 3:44 PM   #1
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
modulo arithmetic question

I am writing a program that deals with ciphers and codes. When the user enters a set of text and a number after being prompted, they are taken to this function:

for (i = 0; i < len; i++)
    { 
         workingtext[i] = workingtext[i] + ikey; //add the key to the plaintext                                                                                            	
    }                                                                                           	
    return workingtext;
}
where len is the length of workingtext

I want the resulting workingtext to only be a letter a-z, not any of the wierd computer characters (e.g. smiley faces, musical notes and french circumflex accents (just some of my favourites)). I think that it probably just requires a modulo thingy in here somewhere, can some one indicate where?
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote