GoTo function like CMD?

Posts 15 of 5 · Page 1 of 1
GoTo function like CMD?
I tried using, "system(":test2");"
and then "system("goto :test2");"
but it didn't change the way the program ran at all.

Is there anything similar to the CMD goto command that would allow you to skip around in C++ code, or would it merely be easier with functions?

Also, before you say something along the lines of "Read the fucking manual", I've looked through 2 books today and search online for about an hour with no results.
Quote Originally Posted by That0n3Guy View Post
I tried using, "system(":test2");"
and then "system("goto :test2");"
but it didn't change the way the program ran at all.

Is there anything similar to the CMD goto command that would allow you to skip around in C++ code, or would it merely be easier with functions?

Also, before you say something along the lines of "Read the fucking manual", I've looked through 2 books today and search online for about an hour with no results.
If your trying to skip around in code like that... though I don't recommend it just create a jump point by saying something like [php] int i;
test: // will jump back to this point
doSomethin();
doSomethingElse();[/php]

[php]
int i = 3;
goto: test; // will jump back to the line test and execute from there
...
doSomething3();
[/php]

At least I'm pretty sure that is how it works. Tell me if I'm wrong.
avoid go to.
you almost never have to use it and it makes the code difficult to read

Quote Originally Posted by lalakijilp View Post
avoid go to.
you almost never have to use it and it makes the code difficult to read
Yeah That... I've never had to use a GOTO in C++..
if you REALLY wanted to though you still can:

Code:
///...some code..

goto myLabel;

//...some code...

myLabel:
     DoSomething();
I've never had to use goto either. But i've always wanted to.
Posts 15 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?