cin.getline problem

I tried to write a password encode program,but the it doesn't seem to let me enter the string.Here is a part of the program in main().

cout << "Please select mode\nA.Encode\nB.Decode" << endl;
cin.get(Mode);
switch(Mode)
{
case 'A':
cout << "Please enter text(not more than 100)" << endl;
char Word[101];
cin.getline(Word,100);
Encode(Word);
b1=false;
break;
..............
I tried putting a system("PAUSE"); in between line 7 and 8.
It says like
"Please enter text(not more than 100)
Press any key to continue.."
What is the problem??
 
cin.getline(Word,100);


this is the line that allows the user to type, if you pause before it then obviously you won't be able to.

also, why don't you use a string? I won't even mention the fact you're using 'namespace std;' and 'system();'
Opps,I put PAUSE between 8 and 9.It is just a typo.
You need to use string
Topic archived. No new replies allowed.