Bresser
May 6th, 2013, 09:08 PM
Ok so what I am making is a program that converts a message into gibberish using:
std::string str;
cin >> str;
int index=0;
while(str[index])
{
str[index]=(str[index]+1)%256;
index++;
}
std::cout << str;
But this poses two questions:
1. with cin it doesn't allow for spaces. What can I use that does?
2. how would I convert it back to the message you type in
std::string str;
cin >> str;
int index=0;
while(str[index])
{
str[index]=(str[index]+1)%256;
index++;
}
std::cout << str;
But this poses two questions:
1. with cin it doesn't allow for spaces. What can I use that does?
2. how would I convert it back to the message you type in