I have issue with my piece of code. I tried find answer already but nothing that applies to my code realy worked. So here is the thing, Im trying get multiple characters input using string and save it in variable inside either switch or if statement doest realy matter I can adapt code to any of othese. Problem is I can easly save one word to my variable using cin but somehow cannot manage to get multiple words saved in my 2nd variable. I think its little mistake or something made wrong at my side but I realy have no idea where Im making mistake.
the main concept of software is using class with priv field of map and few basic funtions inside to manipulate field inside while keeping main.cpp clean and separate it on modules functions. below is first module funtion responsible for adding word with definition to map.Im using namespace std in main.cpp so not need to use std:: all time.
string userInputKey, userInputDef;
cout << "section 1.) add word to dictionary" << endl;
cin >> userInputKey;
cout <<"Ur word input: "<< userInputKey << endl;
cout << "What definition U want to provide for that word: " << endl;
getline(cin, userInputDef);
cin.get();
cout << "Ur def input is: " << endl;
Dictionary newWord;
newWord.setWord(userInputKey,userInputDef);
mainMenu();
after calling function it should execute code above somehow variable userInputDef doesn't want to be working as intended. Im using Visual studio community edition 2019.while program running section 1