|
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 !
|