while (true)
{
while (true)
{
int h = ok_group_join(gr);
if (h == 0)
ok_group_post(gr);
else if (h == -1)
{
//How can I go to first while cycle?
}
我在我的代码中写了一条评论,我怎样才能从那里回到第一次循环?
答案 0 :(得分:1)
while (true)
{
string acc = "";
lock (accslocker)
{
if (accs.Count == 0)
{
break;
}
else
acc = accs.Dequeue();
}
string cook = od_auth(acc);
if (cook != "badacc")
{
string gr;
while (true)
{
int h = ok_group_join(gr);
if (h == 0)
ok_group_post(gr);
else if (h == -1)
{
//How can I go to first while cycle?
break;
}
break
关键字会让您退出。
答案 1 :(得分:1)
答案 2 :(得分:0)
甚至比使用break
更好的是将内循环重写为while (true)
。
while (true)
{
int h = 0;
while (h != -1)
{
h = ok_group_join(gr);
if (h == 0)
ok_group_post(gr);
}
}