After cin>>x, input stream contains new line character.
getline read input stream to until a new line character found.
std::cin.getline(Text,29);
returns because it found the remaining '\n' character in the input stream.
After cin>>x, clear the input stream by the following code, and getline will work.
int x;
std::cin>>x;
std::cin.ignore(std::cin.rdbuf()->in_avail());