not complete yet, but builds with no errors. When i select 1, it executes encode() but it only prints "What do you want to encode?" and then the program doesn't go any further and finishes not giving you a chance to input anything. Could someone help?Code:#include <iostream> void encode() { using namespace std; char szInput[255] = { 0 }; cout << "What do you want to encode?" << endl; cin.getline(szInput, 255); for(int iii = 0; iii < 255; iii++) { if((int)szInput[iii] > 64 && (int)szInput[iii] < 123) { szInput[iii] = (int)szInput[iii] + 13; cout << szInput[iii]; } else cout << szInput[iii]; } } int main() { using namespace std; cout << "What do you want to do?" << endl; cout << "1. Encode" << endl; cout << "2. Decode" << endl; int nSel; cin >> nSel; switch(nSel) { case 1: encode(); break; case 2: break; default: main(); } }




Reply With Quote