结构 在oc中只能声明变量 不能声明函数和类

结构声明

struct DateT {

int month;

int day;

int year;

};

结构可以在起最后的分号之后定义结构变量,并且可以格式化
 

struct DateT {

int month;

int day;

int year;

}today{1,2,3};

结构可以不定义名字 ,但是要先声明变量

struct {

int month;

int day;

int year;

}today{1,2,3};

结构可以嵌套
 

struct DateT {

int month;

int day;

int year;

};

struct Time {

int hours

int seconds;

int min;

};

struct DateTime {

struct DateT date;

struct Time time;

}today{1,2,3};

 调用和平常调用一样  就是多了一个嵌套
 
 
 
 
 
 

最新文章

  1. YII2-数据库数据查询方法,关联查询with, joinWith区别和分页
  2. 使用.NET读取exchange邮件
  3. 对于git的认识
  4. py变量
  5. hdoj 2050 折线分割平面
  6. MacOS U盘安装
  7. ssh登录失败处理步骤
  8. Android剪裁图片简单的方法
  9. Keepalived+Nginx提供前端负载均衡+主从双机热备+自动切换
  10. HDU1201 水题
  11. 2018-2019-1 20165205 ch02 课下作业
  12. 实战ELK(3) Kibana安装与简单实用
  13. walle多渠道打包+Tinker(bugly)热更新集成+360加固(乐固)
  14. Confluence 6 应该如何在我的空间中组织内容
  15. PMP基本概念
  16. Python+Selenium笔记(二):配置谷歌+IE环境
  17. 查看是否存在tomcat进程和关闭方法
  18. lua lua_settable
  19. bzoj3901
  20. Spring Boot学习——单元测试

热门文章

  1. 搭建高可用mongodb集群—— 分片
  2. C# 获得两日期之间所有月份(包括跨年)
  3. 使用SQLCipher加密数据库
  4. HDU 1194 - Beat the Spread!
  5. Apache+tomcat的整合
  6. mac git 命令提示
  7. maven+springmvc+easyui+fastjson+pagehelper
  8. 使用StackTrace堆栈跟踪记录详细日志(可获取行号)
  9. Sql Server专题三:SQL操作与技巧
  10. ca 证书、签名