the case/switch statement in c++
<p>I am trying to learn C++ and so far i have been on the right but i have been have a simple problem and i am getting confused on the case statement i have known how to deal with the if statement and i understand it very well,i working classes and methods in my code below which works perfectly i want to know how i can change this <code>if statement</code> and replace it with the <code>case statement</code>,when i try it its not working  but this is my code for the if statement how can i make it work if i want to use <code>case</code> instead of <code>if</code>??thanks in advance</p>

<p>my code</p>

<pre><code>void SetType(){
        cout&lt;&lt;"Book SetType"&lt;&lt;endl;
        Choice:
        cout&lt;&lt;"Please Select from the list: \n 1- Technical literature \n 2- Fiction literature \n 3- Textbook"&lt;&lt;endl;
        int i;
        cin &gt;&gt; i;
        if ((i&gt;0)&amp;(i&lt;=3)) {
            if (i==1) Type="Technical literature";
            if (i==2) Type="Fiction literature";
            if (i==3) Type="Textbook";
        }
        else 
        {
            cout &lt;&lt; "Erorr you entered a wrong choice" &lt;&lt; endl;
            goto Choice;
        }

    }
</code></pre>
