您的位置:首页 > 其它

Sybase 11.1笔试火热出炉

2007-11-01 21:40 405 查看
2008 SJTU

选择题:

挑几个记得的典型

选择题:

1. 改错

int main()
{

int x//* = 10*/;
return 0;
}

很显然,//把后面全注释掉了,缺少;

如果你搞不清楚是取//还是/* */

那么你参见《C陷阱与缺陷》,所谓的“贪心”原则

2. 改错..大概是这样

#include <stdio.h>

double sum(double a, double b, double c)
{
return(a+b+c);
}

int fx()
{
if(1)
{
break;
fx();
}
}

int main()
{
printf("%f", sum(10.2, 12.3, 16.1));
fx();
return 0;
}

运行,发现break statement not within loop or switch

3. 又见此题,上次威盛考过,不过这次简化了,直接把数字给出了16进制了

#include <iostream>
using namespace std;

int main()
{
int x = 0x1E61, countx = 0;
while(x)
{
countx++;
x=x&(x-1);
}
cout << countx;
return 0;
}

0x1E61 = 1 1110 0110 0001

数下一共几个1,答案就是7

4. 打印输出

void foo(int *a)
{
a= new int;
*a = 20;
}

int main()
{
v = 10;
foo(&v);
printf("%d", v);
return 0;
}

显然,打印仍然是10, foo其实没有对v做什么,虽然是传递的地址

就记得这么多了

简答题:

1. Iterator Pattern 与for-loop的迭代方式有何优势?

设计模式之一:迭代模式

2. In RDMBS what is transaction? What is transaction log? Why we need transaction log?

我不太懂关系数据库管理系统,乱答的

我答的是存取过程,存取过程记录,以及因为需要回滚操作所以要log

3. What is virtual function? How compliers implement the virtual function?

不说了吧

4. Write program(psudo code) how to know a linked list has a circularum?

出了很多次了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: