What numbers are considerd "true" when doing a logical operation?数组
What are inline functions?less
What is memory alignment?ide
指针,传地址,引用区别?函数
What are the possible problems when implicitly using copy constructor?工具
Explain the need for "Virtual Destructor"?优化
Write the output:指针
class A
{
public:
A()
{
cout<<"1"<<endl;
}
~A()
{
cout<<"2"<<endl;
}
void Print()
{
cout<<"3"<<endl;
}
};继承
class B: public A
{
public:
B()
{
cout<<"4"<<endl;
}
virtual ~B()
{
cout<<"5"<<endl;
}
virtual void Print()
{
cout<<"6"<<endl;
}
};ip
A* a = (A*)new B;
a->Print();
B* b = (B*)new C;
b->Print();内存
delete a;
delte b;
给出了许多类(人物,装备,交通工具,场景等)让你画类UML图,注意类之间的继承关系。
优化问题
(1)int a = b*4;
(2)int a = b*72;
(3) int a = b%1;
(4) int a = b %16;
(5) int a = (b+c)/2;
(6) int a = (b %3)/8;
Implement a function that prints the numbers from 1 to 100. But for mutiples only for 3 print "Three" instead of the number, and for mutipless only for 5 print "Five" instead of the number and for mutiples for both 3 and 5 print "ThreeFive" instead of the number.
Implement the following compression function.实现函数,输入是字符串“AABBBCDDDDD”,要求输出是"2A3BC5D"(字符串中都是字母表中的字母)String Compress(String text);
Compress("AABBBCCCCCDDDF"); //输出是 2A3B5C3DF
Compress("XXYYYZXXX");//输出是2X3YZ3X
Compress("XYZ"); //输出是XYZ
(实现函数,将32位RGB(8位标记(没用)+8位R+8位G+8位B),输出为16位RGB(5+6+5)格式)。Implement the following convertion function.
unsigned short ConvertRGB8888toRGB565(unsigned int nSourceColor);
Parameters: 32 bits color as converted color
return: 16 bits color
Color Help: RED = 0x00FF0000;
GREEN = 0x0000FF00;
BLUE = 0x000000FF;
WHITE = 0x00FFFFFF;
BLACK = 0x00000000;
上机题
给出了刚起步一个俄罗斯方块的项目,实现具体如下5个地方
(1)每个方块出现的时候都是在左上角,修改代码,实现,方块出现的地方,是屏幕的正上方。
(2)完善F函数,该函数的做用是在方块下落过程当中,若是判断方块改变形状之后会不会超出屏幕。
(3)有内存泄露,找到并修改。
(4)数组MAP[AAA][BBBB]的具体含义是什么,在数组定义以前中中英文说明。
(5)暂时忘记了,想到了再补上这一条
其余说明:笔试和上级的总共时间是4个小时,本身合理安排。笔试中,若是你不能用英语很好的表达你本身的想法,能够使用中文。