摘要:
enum direction{east,west,south,north};enum direction myDirection;等价于:enum {east,west,south,north} myDirection;//定义了一个(未命名)枚举数据类型,它包含的值为east,west,south,north,同时还声明了该类型的变量direction。 阅读全文
摘要:
static int gCounter;@implementation Fraction+(Fractoin *)allocF{ extern int gCounter;//由于gCounter定义在该文件中,此行定义可省略; ++gCounter; return [Fraction alloc];}+(int)count{ extern int gCounter;//由于gCounter定义在该文件中,此行定义可省略; return gCounter;}@end#import "Fraction"int main (int argc, char *argv[]){ @au 阅读全文