do while loop with nested if statements not exiting in c++
<p>OKay, so I'm new to the whole do while loop thing, and I'm trying to make a main menu, here's my code below:</p>

<pre><code>int main()
{
    int choice;
    char sure;
    bool quit = false;
    char ctrl;

    do
    {
        cout &lt;&lt; "Main Menu." &lt;&lt; endl
             &lt;&lt; "1. New Game." &lt;&lt; endl
             &lt;&lt; "2. Load Game." &lt;&lt; endl
             &lt;&lt; "3. Exit." &lt;&lt; endl
             &lt;&lt; "Your choice: ";
        cin &gt;&gt; choice;

        if (choice == 1)
        {
            cout &lt;&lt; "Are you sure you wish to start a new game? (Y/N) ";
            cin &gt;&gt; sure;

            if (sure != 'N' || sure != 'n')
            {
                ctrl = 'a';
                quit = true;
            }
        }
        else if ( choice == 2)
        {
            ctrl = 'b';
            quit = true;
        }
        else
            quit = true;

        }
    }
    while (quit == true);

    if (ctrl = 'a')
         cout &lt;&lt; "New Game." &lt;&lt; endl;
    else if (ctrl = 'b')
         cout &lt;&lt; "Load Game." &lt;&lt; endl;
    else
         cout &lt;&lt; "Goodbye." &lt;&lt; endl;

    return 0;
}
</code></pre>

<p>there are a few getchar() thrown in there. But the only problem is as you'll probably figure out is that after I do everything it just restarts again, and not exit the loop. What is the problem in the code?</p>

<p>Thanks</p>
