Thread: whats that?
View Single Post
Old 10-20-2004, 02:53 AM   #1 (permalink)
cracksevi
Registered User
 
Join Date: Oct 2004
Posts: 14
cracksevi is on a distinguished road
Send a message via ICQ to cracksevi
whats that?

while i was reading a tutorial from a site i reached the goto thingy...but the example thats given there didnt explain really enuf to me....can someone tell me what is that "goto" for?


// goto loop example
#include <iostream.h>
int main ()
{
int n=10;
loop:
cout << n << ", ";
n--;
if (n>0) goto loop;
cout << "FIRE!";
return 0;
}

and the output is : 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, FIRE!


thats the example in the site...but it seems to have no difference than while command..even while command could be more useful there..another explanation can be so nice.....
thanx bros !
cracksevi is offline   Reply With Quote