![]() |
|
#1
|
|||
|
|||
coding a word with a givin factorhi, I have the following problem, I need to code a word with a givin factor
for example: - word = "ABC" - factor = 5 'A' + 5, 'B' + 5, 'C' + 5 so the coded word should be "FGH" can someone help me how I can code this? this is what i've got, so in the for i 've each letter from the givin word, but how can I count the factor so i it counts 5 letters? thx a lot.. CPP / C++ / C Code:
|
|
#2
|
|||
|
|||
|
This shouldn't be too hard, once you know exactly how chars are stored in the computer's memory. They're stored as 8 bit integers, so (unsigned) up to 256 ACSII characters exist. Each character (including punctuation, and system characters) is assigned a number, the ASCII standard is the main. 'A' is represented by 65, 'B' by 66, and so on (check out www.asciitable.com for the rest)
Say you have CPP / C++ / C Code:
CPP / C++ / C Code:
You just gotta be careful when you reach the end of the alphabet, where does 'Z' go to? Does it wrap around? GF |
|
#3
|
|||
|
|||
|
thx a lot dude, i've found it.
|
Recent GIDBlog
Developing GUIs with wxPython (Part 3) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The