For some reason, the exertion operator and get( ) don't cause the DOS to wait for a return. Here is my main function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
int main( int argc, char* argv[] ){
cout << "Enter some text to be encrypted:" << endl;
char* str = new char[50], *key = new char[50];
cin >> str;
cout << endl << "Enter an encryption key:" << endl;
cin >> str;
cout << endl << "\nEncrypted: " << encrypt ( str, key );
cin.get( );
delete [] str;
delete [] key;
return 0;
}
|
Any suggestions?
Last edited on
Put an std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); before the cin.get();.
Last edited on
What will that do? And what am I supposed to include for it? I included iostream and cstdio, but I'm getting errors.
Last edited on
Works like a charm, thanks.
I'm working on this exact code.
Are you reading c++ without fear?
Not exact, but similar...
Last edited on
I read C++ for dummies. Not my best choice, but it taught me plenty of what I needed to know.
And what do I have to include for that? Regular iostream doesn't have it.
And what do I have to include for that? Regular iostream doesn't have it.
Sorry :P
I forgot to add "#include <limits"
:(