本帖最后由 SSIrreplaceable 于 2016-7-12 15:40 编辑
你的结构体强转换表达式错了
结构体的强转换:
- #import <Foundation/Foundation.h>
- typedef struct data {
- int year;
- int moon;
- int day;
- }SSday;
- int main(int argc, const char * argv[]) {
- @autoreleasepool {
-
- SSday day1 = (struct data){1991,11,1};
- SSday day2 = (SSday){1992,2,2,};
- NSLog(@"%d %d",day1.year,day2.year);
-
- }
- return 0;
- }
复制代码
|