Ok, so i found a way to do a simple conversion to ASCII numbers. I can also get those numbers back to a letter. What I can't seem to do is get them to append to the string.
and a few variants.
I have tried to use ciphertext.append(letter);
I get the error message "invalid conversion from 'char' to 'const char'.
I obviously can't declare this as a const type, since it needs to change. I also tried
and got the same. So, how would i go about getting that letter into a string?
Nevermind... I found a way, albeit sloppy... created a string, and appended THAT string to my current one. It works, but is probably using lots of memory that I don't need. Suggestions on cleaning this up?
while (loops < slength)
cout<<int(plaintext[loops]) <<"\n"; //outputs the ascii of the letter
cipher_num = int(plaintext[loops]); //sets the number to that value
letter = char(cipher_num); //sets the char to the letter represented by the ascii
cipherletter = letter; //sets the string to the char value
ciphertext.append (cipherletter); //appends the string to the cipher text.