in the old days you would use (goto 67) to get to a spacific line as some of you would know. if you can, how do you do this in c++
in the old days you would use (goto 67) to get to a spacific line as some of you would know. if you can, how do you do this in c++
c and c++ do not have native line drawing because that is an os-specific task. For MS-Windows os you have to use MS-Windows win32 api GUI drawing functions. I don't think there is a way to draw lines in a 32-bit console program. Of course you can use the old ancient Turbo C++ MS-DOS compiler, but it's not very good for learning the c++ language.
I think he meant loops. Like if you have code on line 2 type goto 2. However in C++ you can do this but you need to put this on that line:
Look up loops, I'm sure there's a tutorial on them on this website.Code:main: //starting point //...code whatever goto main; //this code takes you back to the main: spot.
Trinity: "Neo... nobody has ever done this before."
Neo: "That's why it's going to work."
c9915ec6c1f3b876ddf38514adbb94f0
jmd15,
yup, this will do what was asked.
but raises the question ( for me ):
is the goto method something to be encouraged or discouraged?
since goto loops can easily create infitely repeating loops, aka app lockups.
Originally Posted by Jeff Henager
>>>is the goto method something to be encouraged or discouraged
Highly discouraged. goto has its uses but they are few and far between and never should a goto be used to replace a loop construct.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
infinitely repeating loops can be made using any form of loop. The real problem is that goto commands can make your program very messy.
It's better to stick with the other methods of program control C++ provides.
Typing stuff in Code::Blocks 8.02, compiling stuff with MinGW 3.4.5.
That's what I thought. figured getting it confirmed in a question where someone wants to use it would benefit original questioner.
and a goto loop can cause you to jump around the app to much, breaking function containers etc.
Originally Posted by Jeff Henager