C++ commands to jump to another line

May 8, 2011 at 14:39:57
Specs: Windows 7
i need to check a function which is called in an (if) and if she is not true jump to a previous line outside that (if)
which command should i use?

See More: C++ commands to jump to another line

Report •


#1
May 8, 2011 at 16:00:52
It sounds like you need a loop. Which kind of loop depends on the situation.

How To Ask Questions The Smart Way


Report •

#2
May 9, 2011 at 05:30:13
i should have explained it more...
my code is something like that

if(......){

if(){

}//if

else{}

}//if(......)

else{}

i need a command to use to branch my code in case the second if is not met...
i thing am going to use the goto command to restart my first loop and check it again.
something like that:

start:
if(......){
if(){
}//if
else{
goto start;}
}//if(......)
else{}

is it right or wrong?


Report •

#3
May 9, 2011 at 05:37:35
Still sounds like you need a loop, and a continue statement. There's always goto, but it's probably not what you really want.

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
May 9, 2011 at 05:54:46
thanks a lot !
what would you recommend here?
any ideas?
any links i could read or take ideas from?


Report •

#5
May 9, 2011 at 06:32:12
Something like this, I'd imagine.
while (........) {
  if (......) {

    if() {

    } else {
      continue;
    }

  } else {
  }
}

How To Ask Questions The Smart Way


Report •

#6
May 9, 2011 at 06:35:56
thank you

Report •

Ask Question