Ok, eventually this program is going to encode messages (I am learning how to program) but for some reason it isn't stopping at my getline command, can you tell me why?
Here is the code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
bool progTerm = false;
while(progTerm == false)
{
char instring[1001];
char outstring[1001];
int choice = 0;
cout << "Welcome to Caeser, Please type the number of your selection:" << endl;
cout << "1. Encode Message" << endl << "2. Decode Message" << endl << "3. Exit" << endl;
cin >> choice;
switch(choice)
{
case 1:
cout << "Type your message(max of 1000 characters):" << endl;
cin.getline(instring, 1001, '\n');
cout << instring;
break;
case 2:
break;
case 3:
progTerm = true;
break;
}
}
return 0;
}
Also, here is the .exe file, as you can tell it skips right by asking for the string.
http://home.comcast.net/~dwcnmv/program.exe




Reply With Quote