So, I have an assignment for school in which the user enters a filename and three integers from 0 to 26, using these integers one by one the program is supposed to decrypt a message from the file. however, mine wont work when it hits a whitespace, and when i try to use noskipws, the program stops at the first whitespace. Can anyone help me fix it.
const char BLANK = ' ';
char ans, letter;
string filename;
int currentNum = 0;
int x=0;
int lineLoop=0;
int first, second, third;
string lineInFile;
char eachChar;
string alphabetCaps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alphabetLower = "abcdefghijklmnopqrstuvwxyz";
the user enters the integers and filename here.
int decryptionArray[3] = {first, second, third};
do {
infile >> noskipws >> lineInFile >> ws;
for (lineLoop=0; lineLoop<lineInFile.length(); lineLoop++)
{
eachChar = lineInFile[lineLoop];
for (int letterChecks = 0; letterChecks < 26; letterChecks++){
Ok I solved the whitespace problem, but now after a space, the decryption falls apart until a little while later. what do I do?
I corrected the whitespace problem by replacing