//創建新類型 typedef struct { int age; char name[20];//最大字節為 20 }Student;
Student value2 = {1,*strcpy(value2.name, "證書")}; /* 把字符串拷貝到 char 裡面去 strcpy(value2.name, "證書"); */ // char 轉 NSString NSString *str = [NSString stringWithUTF8String:value2.name]; NSLog(@"%d---%@",value2.age,str);