For some reason this loop only reads and executes the program for the first line of the text file. How can I read all four lines? I know it's easy but I just can get it :(
Any and all help is appreciated.
Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
do {
cin.ignore();
getline (infile,input);
string output = "";
for(int x = 0; x < input.length(); x++) {
output += cipher(input[x]);
}
cout<<output<<endl;
outfile<<output;
system ("pause");
return a;
}
while(getline(infile, line));