My if function isn't correctly working

Mar 29, 2017 at 10:20pm
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 Mar 30, 2017 at 2:19pm
Mar 29, 2017 at 11:00pm
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 Mar 29, 2017 at 11:00pm
Mar 29, 2017 at 11:04pm
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 Mar 29, 2017 at 11:05pm
Mar 29, 2017 at 11:12pm
THANK YOU SOO MUCH!!!
Mar 30, 2017 at 4:21am
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!
Mar 30, 2017 at 11:00am
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.
Mar 30, 2017 at 2:17pm
Whoops, I aplogize. Code is back up w/ solution.
Last edited on Mar 30, 2017 at 2:18pm
Mar 30, 2017 at 2:42pm
Whoops, I aplogize. Code is back up w/ solution.

well done, thank you
Mar 30, 2017 at 4:53pm
Thankyou. It's much appreciated!
Topic archived. No new replies allowed.