08 2012 档案

摘要:http://www.yaosansi.com/post/135.html 阅读全文
posted @ 2012-08-22 16:53 nchxmoon 阅读(126) 评论(0) 推荐(0) 编辑
摘要:在C++中,class和struct有下面几个主要的区别: 1. 默认访问权限不同:class -- private,struct -- public; 2. 默认继承权限不同:class -- private,struct -- public; 3. class可以用于定义模版参数,struct不可以; 4. 赋值方式不同:struct可以用{}赋初始值,class不可以; 5. 一般使用上的不同:struct主要用于自定义数据结构,是一种数据逻辑结构的设计; class是指数据与方法的封装,保持数据与行为的一致性,是一种编程思想。 阅读全文
posted @ 2012-08-12 20:26 nchxmoon 阅读(202) 评论(0) 推荐(0) 编辑
摘要:最近在读Effective C++,有一些可能大家比较容易忽略的问题,特地写出来和大家分享一下!Item4:Make sure that objects are initialized before they're used. (确保对象被使用前已经被初始化)对于这个条款,相信大家都有了足够深入的了... 阅读全文
posted @ 2012-08-04 11:06 nchxmoon 阅读(1579) 评论(0) 推荐(0) 编辑