Witam, dla czego instrukcja getline jest omijana i nie można wpisać nic do zmiennej przywitanie?
#include <iostream>
using namespace std;
string imie, przywitanie;
int main()
{
cout << "Podaj imie: ";
cin >> imie;
if ( imie [ imie.length () - 1 ] == 'a' )
{
cout << "Imie " << imie << " Jest imieniem zenskim." << endl;
}
else
{
cout << "Imie " << imie << " Jest imieniem meskim." << endl;
}
cout << endl << "Imie " << imie << " od tylu to ";
for ( int i = imie.length () - 1; i >= 0; i -- )
{
cout << imie [ i ];
}
cout << endl << endl << "Przywitaj sie: ";
getline ( cin, przywitanie );
cout << endl << przywitanie + imie;
return 0;
}