| nilsson (3) | |||||
Im using this code to encrypt a text
and this to decrypt
but the decryption dosent work as wanted :/ any tips on what the problem is? | |||||
|
Last edited on
|
|||||
| DiptenduDas (91) | |
|
Hi nilsson, In the decrypt function after 1st iteration i gets decremented to -1, which will be creating problem for a[i]. Also keep a close look in to the Precedence of C++ Operator ..... | |
|
Last edited on
|
|
| guestgulkan (2830) | |
| I agree with DiprenduDas ---- that bit of math(s) is very suspicious | |
|
|
|
| Zaita (2301) | |||
|
Formatting pls, this isn't the obfuscated C contest. Your encryption code looks fine, but your decryption is a little off as you have said. Remember, to Decrypt you need to do the exact opposite of what you have done to encrypt. This can be as simple as changing 1 operator and your target for the assignment. e.g.
| |||
|
|
|||