How do I exactly use the goto token?
How do I exactly use the goto token?
This function will loop forever, but it illustrates the point. Try not to use gotos as much as possible.Code:#include <iostream.h> int main() { loop: cout << "Hello world!" goto loop; return 0; // This code will never be reached. }
Goto is an absoulte jump, mainly used in BASIC.
The use of goto in c++ is considered bad programming practice.
Homer
D'OH!
mmmmmmmm... iterations