四种不同对象的生存方式(栈、堆、全局、局部静态)
//东软2012-11月笔试题
class Sample{ int x;public: Sample(int a) { x = a; cout << "constructing : x =" << x << endl; }}; void func(int n){ static Sample obj(n);} int main(){ func(1); func(10); //1 return 0; }
[分析]:题目的考查点,静态对
继续阅读与本文标签相同的文章
下一篇 :
Python3入门(十一)OS文件/目录方法
-
《Linux Shell脚本攻略》 笔记 第八章:磁盘、日志管理
2026-05-24栏目: 教程
-
云大使官方交流群,欢迎加入~
2026-05-24栏目: 教程
-
程序员还要写文档,要会吗?不要会吗? | 开发者必读(017期)
2026-05-24栏目: 教程
-
叮!一份顶级开源项目的邀请函,请查收~
2026-05-24栏目: 教程
-
《Linux Shell脚本攻略》 笔记 第七章:网络操作
2026-05-24栏目: 教程
