Oh one thing, sorry about the thread name. Im working on two encryptions and forgot that i had written ASCII problem... got confused...
I dont think i want to start changing the arrasy to strings. I dont know how to use strings like that and im pressed for time. And besides the encryption and decryption works the way its supposed to so, i got it working the way i wanted to! Well... except for the pause thing...
I dont want to open it in using cmd, i want to be able to doubleclick the program. I read FAQ > How do I... (Level 1) > How do I get my program to wait for a keypress?, linked from the one joshdick gave me
and the reason i wanted to use cin.get is that its the C++ way! No other reason... But still, i dont know how to get it working.
Just for the sake of it (and becasue its alot smaler), here is the new code:
Code:#include <iostream> #include <conio.h> using namespace std; char key[13]="ABCDEFGHIJKL"; int main() { char input[13]; cin.getline(input, 13); for(int x=0; x<12; x++) { input[x] = input[x]^key[x]; cout << input[x]; } cout << endl; for (int x=0; x<12; x++) { input[x] = input[x]^key[x]; cout << input[x]; } cout << endl << endl; /*cin.ignore(); cout << "Press Enter" << endl; cout << endl; cin.get();*/ getch(); return(0); }