Loop Question
#5

Quote:
Originally Posted by Anthony_prince
Посмотреть сообщение
Vince said break is same as return 0 but also goes to first line of the loop.
Nah, he said that it goes to the first line after the loop
pawn Код:
for (new a = 0; a < 3; a++)
{
    if (a == 1) break; //called
    printf("a = %d", a);
}
//Will be called next

for (new a = 0; a < 3; a++)
{
    if (a == 1) return 0; //called
    printf("a = %d", a);
}
//Won't be called at all as the callback / function has been given a return value.
Reply


Messages In This Thread
Loop Question - by TheArcher - 24.07.2011, 23:03
Re: Loop Question - by Vince - 24.07.2011, 23:10
Re: Loop Question - by [HiC]TheKiller - 24.07.2011, 23:12
Re: Loop Question - by TheArcher - 24.07.2011, 23:14
Re: Loop Question - by [HiC]TheKiller - 24.07.2011, 23:25
Re: Loop Question - by TheArcher - 24.07.2011, 23:30

Forum Jump:


Users browsing this thread: 1 Guest(s)