Code:if (un[i] == ' ') en[i] = ' '; else en[i] = (((un[i] - 'a') + offset) % 26) + 'a';
Code:if (un[i] == ' ') en[i] = ' '; else en[i] = (((un[i] - 'a') + offset) % 26) + 'a';
If you understand what you're doing, you're not learning anything.
Don't use that:Code:fflush(stdin);
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Originally Posted by itsme86
Allright, if string "un" contains characters besides the ones we're interested in encrypting - send them (space in this case) to string "en" as is. Got it!
Thank, again :-)
I will read the FAQ as soon as possible. I've only used fflush to make the screen stick after the program has run. But I'll check the FAQsDon't use that:Code:Code: fflush(stdin);
* FAQ > Explanations of... > Why fflush(stdin) is wrong
* FAQ > How do I... (Level 2) > Flush the input buffer
Thanks!