以下程序是实现定义一个符号常量,并输出。程序代码如下:
运行结果如下:
2015-01-18 10:36:14.641 Sample.3.2[970:45982] Hello, This is a sample 3.2 of the book 《iOS7 开发快速入门》!
2015-01-18 10:36:14.642 Sample.3.2[970:45982] 3.141593
Program ended with exit code: 0
#import <Foundation/Foundation.h>
#define PI 3.14159265
int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
NSLog(@"Hello, This is a sample 3.2 of the book 《iOS7 开发快速入门》!");
NSLog(@"%f",PI);
}
return 0;
}
运行结果如下:
2015-01-18 10:36:14.641 Sample.3.2[970:45982] Hello, This is a sample 3.2 of the book 《iOS7 开发快速入门》!
2015-01-18 10:36:14.642 Sample.3.2[970:45982] 3.141593
Program ended with exit code: 0