Code:
...
cin.getline(string1, 20);
cout<<'\n';
cin.getline(string2, 20);
...
here's a suggestion: use cin.get() and include the terminating character (usually '\n') for the string, so the string can be less than 20 characters. That way the person presses enter, the get() stops, and the next get() continues, and is reading on the next line....
Code:
...
cin.get(string1,20,'\n');
cin.get(string2,20,'\n');
...
I think that works... if it doesn't work properly, put a cin.ignore(1,'\n') in between the two cin.get().