![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c/c++
xiaohuazhiqing
这个作者很懒,什么都没留下…
展开
-
sizeof扩展
一道题 #pragma pack(2) class A { int i; union U { char buff[13]; int i; }u; void foo() { } typedefchar* (*f)(void*); enum{red, green, blue} color; }a; size转载 2014-08-28 15:08:54 · 457 阅读 · 0 评论 -
c++题目精选
题目(一):我们可以用static修饰一个类的成员函数,也可以用const修饰类的成员函数(写在函数的最后表示不能修改成员变量,不是指写在前面表示返回值为常量)。请问:能不能同时用static和const修饰类的成员函数? 分析:答案是不可以。C++编译器在实现const的成员函数的时候为了确保该函数不能修改类的实例的状态,会在函数中添加一个隐式的参数const this*。但当一个成员为sta转载 2014-08-31 01:44:44 · 364 阅读 · 0 评论