Browsing all articles tagged with switch statement - Share Programming Tips
Jan
28

Why variables can not be declared in a switch statement just after labels?

see this code

#include<stdio.h>
int main()
{
   int i=1;
   switch(i)
   {
       case 1: int x=10;
               printf(" x is %d",x);
       break;
    }
    return 0;
}

Do you think this code will compile? if yes then you need to read this post….

read more

Follow us on Twitter! Follow us on Twitter!

Search in this website

our sponsors

latest comments

Find us on Facebook

Top Authors

35 posts
saurabh
21 posts
9 posts

Find us on stackoverflow

Polls

Tell us who you are

View Results

Loading ... Loading ...

My Bookmarks

Sponsers Link