My if function isn't correctly working

1
2
3
4
5
6
7
8
9
if(choice == 'e' || 'E')
	{
		encryption(in_stream, out_stream); //function to encrypt
	}
	else 
	{
		decryption(in_stream, out_stream); //function to decrypt
	}


EDIT** The fix was (choice == 'E')
Last edited on
It looks like you are passing the correct key to your decryption() function, but it looks like your decryption function is probably not correct. Are you sure your reversing your encrypt function, it appears to me that you're re-encrypting the encrypted input?

Last edited on
well, he is!
if(choice == 'e' || 'E')
'E' is true.

should be

if(choice == 'e' || choice == 'E')

D has a similar problem.
Last edited on
THANK YOU SOO MUCH!!!
THANK YOU SOO MUCH!!!

and then you go and remove the OP so that nobody else can benefit from whatever advice you benefited from. Classy!
pdgaming, please DON'T do this. This forum is a resource for people to learn from. By deleting your question, you've made this thread useless for others.

It's a selfish abuse of this forum.
Whoops, I aplogize. Code is back up w/ solution.
Last edited on
Whoops, I aplogize. Code is back up w/ solution.

well done, thank you
Thankyou. It's much appreciated!
Topic archived. No new replies allowed.