【问题】code1不能编译,code2没有问题。所以为什么?【code1】</p>
#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;
}
【code2】</p>
#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;
}
【通知】</p>
这个编程环境是由GNU Gcc在win7下建立的。
希望大家说的详细些,非常感谢!</p>