中软集团笔试题.docx
《中软集团笔试题.docx》由会员分享,可在线阅读,更多相关《中软集团笔试题.docx(6页珍藏版)》请在冰点文库上搜索。
中软集团笔试题
中软集团笔试题
中软集团题目
目一
一.简答题.
1.避免死锁的方法有哪些?
2.在Sybase数据库中注册用户与数据库用户有什么区别?
3.在MSSQL_Server数据库中通过什么约束保证数据库的实体完整性
4.内存有哪几种存储组织结构.请分别加以说明
5.JAVA中的Wait()和notify()方法使用时应注意些什么?
6.用户输入一个整数.系统判断,并输出是负数还是非负数,请设计测试用例.
7.操作系统中的同步和互诉解决了什么问题
8.UNIX中init
二.编写类String的构造函数,析构函数和赋值函数
已知类String的原型为
classstring
{
public:
string(constchar*str=null);//普通构造函数
string(conststringother);//拷贝构造函数
---string(void);
stringoperate=(conststringother);//赋值函数
private:
char*m-data;//用于保存字符串
};
请编写string的上述4个函数
三.有关内存的思考题
1.voidgetmemory(char*p)
{p=(char*)mallol(100);
}
voidtest(void)
{
char*str=null;
getmemory(str);
strcpy(str,hello,world);
printf(str);
}
请问运行Test函数会有什么样的结果
2.char*getmemory(void)
{charp[]=helloworld
returnp;
}
voidtest(void)
{
char*str=null;
str=Getmemory();
printf(str);
}
请问运行Test函数会有什么样的结果.
笔试题目二
问题:
Writeafunctiontogetthesecondmaximumnumberinanintegerarray.(请写程序返回一个数组中第2大的数)
intgetsecond(inta[])
答案:
intgetsecond(inta[],intnLength)
{
intnMax=-1000,nSec=0;
for(inti=0;inLength;i++)
{
if(nMaxa[i])
{
nSec=nMax;
nMax=a[i];
}
else
{
if(a[i]nSec)
nSec=a[i];
}
}
returnnSec;
}