I've tried cin >> userInput; and it stops reading the word after it hits a space. but then I tried cin.get and it just skips all the other cins. Then I tried cin.getline and it skips over the userInput cin and goes right to the next cin (cin >> direction).
What am I doing wrong? How do I get user input and read it in as char array. I'm not allowed to use strings so they must be C-style. Thanks!
void encode(){
char userInput[100], direction[9], keyword[15];
int transposition;
cout << "Enter the text to be encoded: ";
cin.get(userInput, 99);
cout << userInput;
cout << "Enter direction (Forwards or Reverse): ";
cin >> direction;
cout << "Enter transposition value (0...25): ";
cin >> transposition;
cout << "Enter a keyword for Vigenere encryption: ";
cin >> keyword;
}