下面是代码:
#import <Foundation/Foundation.h>
typedef struct student{
int age;
double height;
}* myStu;
int main(int argc, const char * argv[]) {
@autoreleasepool {
myStu stu1,stu2;
stu1->age=20;
stu1->height=46.0;
stu2->height = 50.0;
stu2->age=20;
NSLog(@"%d-%f-%d-%f",stu1->age,stu1->height,stu2->age,stu2->height);
}
return 0;
}
编译的时候一丁点错误都没有,可是运行崩溃,求解,求搭救 |
|