Hi Folks,

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.

Code:
 #include <iostream>
#include <string>

class flash_card
{
    std::string question[15];
    std::string answer[15];

    public:

    flash_card()
    {
        std::cout<<"constructing class\n";
    }

    int feed();

    void test(int& total_noofqs);

    void right(const int index, int& totalqs);

    void wrong();

    void learn();

    ~flash_card()
    {
        std::cout<<"Deconstructing class\n";
    }
};

int number_of_questions=0;

int flash_card::feed()
{
    bool y=true;
    int i=0;
    char return_value;

    for(i=0;(y=true);++i)
    {
        std::cout<<"\nEnter the word: ";
        std::getline(std::cin,question[i]);    //not executing, problem lies in this block
        std::cout<<"\nEnter its meaning: "; 
        std::getline(std::cin,answer[i]);
        std::cout<<answer[i];
        std::cout<<"\nPress n to exit or other key to continue: ";
        std::cin>>return_value;
        if(return_value=='n')
        y=false;
    }
    number_of_questions=i+1;
    return(number_of_questions);
}

void flash_card::test(int& total_noofqs)
{
    int i=0;
    std::string local_answer;
    char return_value;
    while(i<total_noofqs)
    {
        std::cout<<"meaning for "<<question[i]<<" is?\n";
        std::getline(std::cin, local_answer);
        if(answer[i]==local_answer)
        {
            right(i, total_noofqs);
            continue;
        }
        else
        wrong();
        ++i;
        std::cout<<"\nDo you wanna continue the test: ";
        std::cin>>return_value;
        if(return_value=='n')
        break;
    }
}

void flash_card::right(const int index, int& totalqs)
{
    int y=0;
    std::cout<<"\nright";
    for(y=0;(y<(number_of_questions-index));++y)
    {
        question[index]=question[index+1];
        answer[index]=answer[index+1];
        --totalqs;
    }
}

inline void flash_card::wrong()
{
    std::cout<<"\nwrong";
}

inline void flash_card::learn()
{
    int x=0;
    for(x=0;x<number_of_questions;++x)
    {
        std::cout<<"\n"<<question[x]<<" : "<<answer[x];
    }
}

int main()
{
    flash_card list;
    int num;
    std::cout<<"\n1:feed, 2:test, 3:learn 4:quit";
    std::cout<<"\nenter ur choice";

    while(true)
    {
    std::cin>>num;
    if(num==4)
    break;
    switch(num)
    {
        case 1:
        list.feed();
        case 2:
        list.test(number_of_questions);
        case 3:
        list.learn();
        default:
        std::cout<<"\nenter a proper choice";

    }
    }
    return(0);
}
In the function int flash_card::feed()
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.

Thanks