摘要: int years = 2001; struct thing { char *ptr; int m; }; thing amabob = {"wodget", 12}; // valid intialization Stock hot = {"Sukie's Autosm, Inc.", 200, 阅读全文
posted @ 2021-02-12 20:24 GaoLee 阅读(160) 评论(0) 推荐(0)
摘要: 结构体是用户定义的类型,而结构声明定义了这种类型的数据属性。 1 struct inflatable // structure declaration 2 { 3 char name[20]; 4 float volume; 5 double price; 6 }; 关键字 struct 表明,这些 阅读全文
posted @ 2021-02-12 19:50 GaoLee 阅读(354) 评论(0) 推荐(0)
摘要: 1. 过程性编程和面向对象编程 采用OOP(Object-Oriented Programming)方法时,首先从用户的角度考虑对象 -- 描述对象所需要的数据以及描述用户与数据交互所需的操作。完成对接口的描述后,需要确定如何实现接口和数据存储。最后,使用新的设计方案创建出程序。 2. 抽象和类: 阅读全文
posted @ 2021-02-09 20:25 GaoLee 阅读(2063) 评论(0) 推荐(0)