I've been playing around with c++ a bit, and made a "encrypt"-"decrypt" thing.
Just basically taking the int value of the letters and adding x to them - becomming a new character/letter.
This is the code where it asks the user for an input:
void decryptonise()
{
string text2;
cout <<"What would you like to \"decryptonise\"?:\n";
cin.get(); getline(cin,text2); //I have this cin.get because the user inputs 2 //to chose decrypt - enter - without it, it would take that enter as input for the //getline
cout <<"\nDecrypted text:\n";
for(int i=0; i<text2.size(); i++)
{
int coop2 = text2[i];
if(i%2==0)
{
cout <<(char)(coop2-33);
}
else
{
cout <<(char) (coop2-18);
}
}
cout<<endl<<"\nPress [ENTER] to go back to the menu.";cin.get();
}
If I paste a text that is longer than a row, it will automatically take that row, decrypt it, and jump out of the function.
How can I fix it?
Here is the whole thing:
http://pastebin.com/7EXASrb9