Friday, January 7, 2011

goto statement in c#

Lets see first one example for that:
        int x = 1;
   loop:
         if (x < 100)
        {
             x++;
            goto loop;
        }
here you need one lable which is used to transfer control using goto statement.
Here you need to take care of using goto statement.otherwise it goes in into infinite statement or skip some code always.

No comments:

Post a Comment