I'm facing a strange problem here. In my code the compiler isn't executing an instruction and is skipping to next instruction.
Below is a program I created for flash card. Here first we feed the program with some words and its meanings. Later vocab is tested by calling one word after another, if user gets it right then the word is deleted and if user gets it wrong the word stays.
Below program isn't commented so don't bother understanding the whole code cause i'm having trouble only in a small part of it.
In the function int flash_card::feed()
void test(int& total_noofqs);
void right(const int index, int& totalqs);
std::cout<<"\nEnter the word: ";
std::getline(std::cin,question[i]); //not executing, problem lies in this block
std::cout<<"\nEnter its meaning: ";
std::cout<<"\nPress n to exit or other key to continue: ";
void flash_card::test(int& total_noofqs)
std::cout<<"meaning for "<<question[i]<<" is?\n";
std::cout<<"\nDo you wanna continue the test: ";
void flash_card::right(const int index, int& totalqs)
inline void flash_card::wrong()
inline void flash_card::learn()
std::cout<<"\n"<<question[x]<<" : "<<answer[x];
std::cout<<"\n1:feed, 2:test, 3:learn 4:quit";
std::cout<<"\nenter ur choice";
std::cout<<"\nenter a proper choice";
line 43 isn't executing
I get the display to enter the word because std::cout<<"\nEnter the word: "; is executuing
However, compiler doesn't wait for me to enter the word(std::getline(std::cin,question[i]); isn't executing).
It continues to execute the next instruction.
If this line doesn't execute then the whole program is useless.
I would really appreciate any help for this problem.