mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Fixed bug in input of Caesar cipher while running
This commit is contained in:
@@ -147,7 +147,14 @@ std::string runCaesar(std::ifstream& infile, bool encode){
|
|||||||
else{
|
else{
|
||||||
std::cout << "Enter the cipher offset: ";
|
std::cout << "Enter the cipher offset: ";
|
||||||
std::cin >> offset;
|
std::cin >> offset;
|
||||||
|
if(std::cin.fail()){
|
||||||
|
std::cin.ignore(10000, '\n');
|
||||||
|
std::cin.clear();
|
||||||
|
std::cout << "That is an invalid offset\nEnter the cipher offset: ";
|
||||||
|
std::cin >> offset;
|
||||||
|
}
|
||||||
std::cout << "Enter the input string: ";
|
std::cout << "Enter the input string: ";
|
||||||
|
std::cin.ignore(10000, '\n');
|
||||||
std::getline(std::cin, inputString);
|
std::getline(std::cin, inputString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user