Switch within Switch Problem

I am trying to put a switch within a switch and I'm getting the error "Duplicate case value" Why am I getting this error? Why does it matter that I'm using the same case values for both switches? If case '2' is applied the first time, and then case '2' is applied again for something different, do this. What's wrong with that?

Thanks,
Timmah \m/
Post your code.
s = getch();
switch (s) {
case '1':
cout << "\n\nWelcome To The General store!\n";
cout << "1) 1 Gallon Water:" << endl;
cout << "2) 1 lb Meat:" << endl;
cout << "3) 5 lbs Meat:" << endl;
cout << "4) Assortment of Spices/Herbs:" << endl;
cout << "5) Wool Gloves:" << endl;
cout << "6) Wool Coat:" << endl;
cout << "7) Light Leather Boots:" << endl;
cout << "8) Pack of 5 Torches:" << endl;
cout << "9) Pack of 5 Lanterns:" << endl;
cout << "10) 1 Quart of Oil:" << endl << endl;
loop16:
cout << "Press 1 - 10 and Then Enter To Purachase An Item. Press 'b' To Go Back To The \nShop List. When done, press 'd'";
cin >> item_type;
switch (item_type) {
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case '10':
{
cout << "Hooray!";
break;
case 'b':
goto loop15;
break;
default:
{
cout << "Incorrect Command!";
goto loop16;
}
}

case '2':
cout << "\n\nWelcome To The Blacksmith!\n";
cout << "1) Hard Leather Gloves:" << endl;
cout << "2) Hard Leather Boots:" << endl;
cout << "3) Hard Leather Torso:" << endl;
cout << "4) Chain Mail Helment:" << endl;
cout << "5) Chain Mail Torso:" << endl;
cout << "6) Chain Mail Pants:" << endl;
cout << "7) Plate Mail Helment:" << endl;
cout << "8) Plate Mail Torso:" << endl;
cout << "9) Plate Mail Pants:" << endl;
s = getch();
if (s=='b')
goto loop15;
break;


The first switch goes on a few more times but that doesn't matter. It's messing up with case '2'
I feel like the problem is the fact that I'm using both int and char. Can I make a switch with both?
A bit of decent formatting might show the problem:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
s = getch(); 
switch (s) {
   case '1':
      cout << "\n\nWelcome To The General store!\n";
      cout << "1) 1 Gallon Water:" << endl; 
      cout << "2) 1 lb Meat:" << endl;
      cout << "3) 5 lbs Meat:" << endl;
      cout << "4) Assortment of Spices/Herbs:" << endl;
      cout << "5) Wool Gloves:" << endl;
      cout << "6) Wool Coat:" << endl;
      cout << "7) Light Leather Boots:" << endl;
      cout << "8) Pack of 5 Torches:" << endl;
      cout << "9) Pack of 5 Lanterns:" << endl;
      cout << "10) 1 Quart of Oil:" << endl << endl; 
     loop16:
      cout << "Press 1 - 10 and Then Enter To Purachase An Item. Press 'b' To Go Back To The \nShop List. When done, press 'd'";
      cin >> item_type;
      switch (item_type) {
         case '1':
         case '2':
         case '3':
         case '4':
         case '5':
         case '6':
         case '7':
         case '8':
         case '9':
         case '10':
         {
            cout << "Hooray!";
            break;
            case 'b':
              goto loop15;
               break;
            default:
            {
               cout << "Incorrect Command!";
              goto loop16;
            } 
         }

         case '2':
            cout << "\n\nWelcome To The Blacksmith!\n";
            cout << "1) Hard Leather Gloves:" << endl; 
            cout << "2) Hard Leather Boots:" << endl;
            cout << "3) Hard Leather Torso:" << endl;
            cout << "4) Chain Mail Helment:" << endl;
            cout << "5) Chain Mail Torso:" << endl;
            cout << "6) Chain Mail Pants:" << endl;
            cout << "7) Plate Mail Helment:" << endl;
            cout << "8) Plate Mail Torso:" << endl;
            cout << "9) Plate Mail Pants:" << endl;
            s = getch();
            if (s=='b')
            goto loop15;
            break;

Your {s don't match your }s
Topic archived. No new replies allowed.