#include <stdio.h>
#include <AssertMacros.h>
int main(int argc, char* argv[])
{
int error = 1;
verify_noerr(error);
require_noerr(error, Oops); //<---- Is Oops a callback method?
printf("You shouldn't be here!\n");
Oops: ; // <--v____ Is this a method declaration?
return error; // <--^ Why the ':' followed by the ';'?
}
此代码是从iOS documentation from 2006。我意识到在C中,没有声明返回类型的方法的默认返回类型是int。但这真的是一种靠这个原理的方法吗?以及为什么结肠分号?我最后的想法是它的C块,但Wikipedia says otherwise。是“糟糕:;返回错误;” C中有效的方法声明?
我很难过。
这是一个goto标签,并声明它是有效的。 – 2013-04-27 22:01:43
它与'switch'中的'case X:'基本相同。 – Sulthan 2013-04-27 22:06:31