- 1
- 0
- 约6.07千字
- 约 17页
- 2026-02-09 发布于福建
- 举报
第PAGE页共NUMPAGES页
2026年游戏开发工程师面试必刷题目
一、编程基础(共5题,每题10分,总分50分)
题目1(C++基础-内存管理)
cpp
includeiostream
usingnamespacestd;
classMyClass{
public:
MyClass(){coutConstructorcalled.\n;}
~MyClass(){coutDestructorcalled.\n;}
};
voidfunc(){
MyClassobj;//自动调用构造函数
staticMyClassstaticObj;//在函数退出后仍存在
}
intmain(){
func();//调用func函数
coutMainfunctionends.\n;
return0;
}
问题:运行上述代码时,输出顺序是什么?解释内存分配和释放的顺序。
题目2(数据结构-堆排序)
cpp
includevector
includealgorithm
includeiostream
voidheapify(std::vectorintarr,intn,inti){
intlargest=i;
intleft=2i+1;
intright=2
原创力文档

文档评论(0)