![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++学习
hanwystar
这个作者很懒,什么都没留下…
展开
-
c++ union位域
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://zhouxiaodan.blog.51cto.com/1177793/1202163 最近碰到一道题,顺带复习一下union的数据分布,题目如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14转载 2013-07-11 09:10:53 · 1128 阅读 · 0 评论 -
c++运算符重载,做为成员函数
/* * *运算符重载,做为成员函数 * Created on: 2013-7-10 * Author: HenryHan */ #include using namespace std; class RMB { public: RMB(unsigned int d, unsigned int c); RMB operator转载 2013-07-10 15:11:58 · 552 阅读 · 0 评论 -
C/C++ union用法(转)
http://blog.chinaunix.net/u2/84450/showart_1829958.html 在C/C++程序的编写中,当多个基本数据类型或复合数据结构要占用同一片内存时,我们要使用联合体;当多种类型,多个对象,多个事物只取其一时(我们姑且通俗地称其为“n 选1”),我们也 可以使用联合体来发挥其长处。首先看一段代码: union myun { struct转载 2013-07-02 10:19:17 · 409 阅读 · 0 评论 -
const char*, char const*, char*const的区别
const char*, char const*, char*const的区别问题几乎是C++面试中每次都会有的题目。 事实上这个概念谁都有只是三种声明方式非常相似: Bjarne在他的The C++ Programming Language里面给出过一个助记的方法: 把一个声明从右向左读。 char * const cp; ( * 读成 pointer to ) cp is转载 2013-07-02 09:54:54 · 326 阅读 · 0 评论