(第一天)object-c枚举和结构体
来源:互联网 发布:linux syslog server 编辑:程序博客网 时间:2024/05/19 10:14
在object-c中枚举的类型只能是整形比如int long short bool(true和false本质上是1和0)等。
struct结构体中的数据不能赋初值,所以赋值只能通过声明加入的方式。
#import <Foundation/Foundation.h>enum sex{ male=0, female=1};typedef enum{ c=3, d=4}test2;struct student { char* name; enum sex sex; int age;};typedef struct student stu;int main(int argc, const char * argv[]){ stu su; su.name="wen"; su.sex=male; NSLog(@"name=%s,sex=%d",su.name,su.sex); @autoreleasepool { // insert code here... NSLog(@"Hello, World!"); } return 0;}
- (第一天)object-c枚举和结构体
- Object-C 学习第一天
- 认识object-c第一天
- C结构体和枚举
- 第五节 Swift 枚举和结构体
- ios 学习第一天 object-c入门
- C语言中的结构体和枚举
- C语言--结构体和枚举
- C语言中的结构体和枚举
- [C++]结构体、共同体和枚举类型
- 初识c#---枚举和结构体
- object-c 结构体
- 集训第一天 结构体
- object-c 循环结构、选择结构、类和继承 第五天
- c#学习第五天 枚举和结构体
- C++、 C 中的结构体、联合和枚举 异同
- 结构体和枚举
- 枚举和结构体
- CSS之关于clearfix--清除浮动
- 《敏捷开发之道》读书笔记
- python 创建mysql数据库
- 硬实时和软实时区别
- SOAP协议 XML-RPC
- (第一天)object-c枚举和结构体
- linux命令
- HTTP Status 404(The requested resource is not available)的几种解决方法
- Zimbra用户对群组发送邮件的权限设置
- windows 下的嵌入式开发
- 删除tableview的section遇到crash:The number of rows contained in an existing section after the update
- you must specify a host type if you use `--no-verify'
- 随想录(写给那些学校不是985、211的同学们)
- java反射机制