#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]){
@autoreleasepool{
NSLog(@"\nProgram is working........\n");
int a=15;
int b=55;
int sum=0;
sum=a+b;
NSLog(@"The equality : %i + %i= %i\n",a,b,sum);
NSLog(@"Program is over!\n");
}
return 0;
}
【码2】
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]){
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];
NSLog(@"\nProgram is working........\n");
int a=15;
int b=55;
int sum=0;
sum=a+b;
NSLog(@"The equality : %i + %i= %i\n",a,b,sum);
NSLog(@"Program is over!\n");
return 0;
}
【通知】
希望各位说的详细些,非常感谢!
答案 0 :(得分:5)
@autoreleasepool
构造是Apple的LLVM编译器的一个功能,在GCC中不可用。