Is there any alternative for goto statement in c programming.
Actually i am planning to make one new simulator for my application. For this simulator i need to go particular place again and again inside main from some other function. Goto only works with in the functions otherwise it won't work. Can any one suggest me any other alternative methods.
Thanks advance.
Separate your main
into functions. Instead of jumping to a location inside main
, execute an appropriate function. That might require passing some parameters to the functions but it surely worth it.