Dlaczego ten kod nie działa prawidłowo i nie przepisuje pobrane inie do tablicy string ?
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
cin>>t;
string *wyraz = new string [t];
for(int i=0; i<t; i++) {
getline( cin, wyraz[i]);
}
for(int i=0; i<t; i++) {
cout << wyraz[i] << endl;
}
return 0;
}