switch statement

guys i always get an error in switch statement
error: switch statement not an integer
1
2
3
4
5
6
switch(select){
case: "Register"
{
    Registration();
    break;
}
Last edited on
For e.g.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int select;
printf("1. Register");
printf("2. UnRegister");
printf("Enter you choice");
scanf("%d",&select);   //User will enter numeric value i.e 1 or 2

switch(select){
    case 1:              //here numeric value will come
   {
        Registration();
        break;
   }
   case 2:
   {
        UnRegistration();
        break;
   }
   default:
   {
         printf("please enter correct option");
         break;
    }
}
Last edited on
Topic archived. No new replies allowed.