2010迅雷笔试题
1.
class a
{
int a;
short b;
int c;
char d;
};
class b
{
double a;
short b;
int c;
char d;
};
求sizeof(a), sizeof(b)分别是多少,考察对内存对齐的理解。
2.
引用可以是void类型吗?
答:不可以。如下程序会出错。
#include
int main()
{
int b;
void &a = b;
return 0;
}
1.
class a
{
int a;
short b;
int c;
char d;
};
class b
{
double a;
short b;
int c;
char d;
};
求sizeof(a), sizeof(b)分别是多少,考察对内存对齐的理解。
2.
引用可以是void类型吗?
答:不可以。如下程序会出错。
#include
int main()
{
int b;
void &a = b;
return 0;
}