(1)将“编号”字段改名为“工号”,并设置为主键。
(2)设置“年龄”字段的有效性规则为不能是空值。
(3)设置“聘用时间”字段的默认值为系统当前年1月l号。
(4)删除表结构中的“简历”字段。
(5)将考生文件夹下“sampO.mdb”数据库文件中的表对象“tTemp”导入到“sampl.mdb”数据库文件中。
(6)完成上述操作后,在“sampl.mdb”数据库文件中做一个表对象“tEmp”的备份,命名为“tEL”。
(1)将“编号”字段改名为“工号”,并设置为主键。
(2)设置“年龄”字段的有效性规则为不能是空值。
(3)设置“聘用时间”字段的默认值为系统当前年1月l号。
(4)删除表结构中的“简历”字段。
(5)将考生文件夹下“sampO.mdb”数据库文件中的表对象“tTemp”导入到“sampl.mdb”数据库文件中。
(6)完成上述操作后,在“sampl.mdb”数据库文件中做一个表对象“tEmp”的备份,命名为“tEL”。
试题五(共 15分)
阅读以下关于 C语言及 C代码的叙述,回答问题 1至问题 3,将答案填入答题纸的对应栏内。
【说明】
在开发某嵌入式系统时,设计人员根据系统要求,分别编写了如下三部分程序,其中:
【C代码 1】是李工为了在嵌入式平台上开发一段可变参数函数,在X86 平台上实现的一个参数个数可变函数实例。
【C代码 2】是王工在编写软件时,自己编写的内存拷贝函数。
【C代码 3】是赵工编写的一段数据处理的程序,其中 fun()的含义为从已创建的一个单向链表中查找倒数第index 个节点。他的设计思路为:首先创建两个指针 ptrl,ptr2,并且都指向链表头,然后 ptrl向前走index 步,这样ptrl和 ptr2 之间就间隔 index 个节点,然后 ptrl和ptr2 同时向前步进,当 ptrl到达最后一个节点时,ptr2 就是倒数第 index 个节点了。ReverseList()为赵工编写的对已有单向链表进行逆序重排的函数。
【C代码 1】
long sum(int i,...)
{
int *p,j;
long s = 0;
p=&i+1;
for(j=0;j<i;j++)
s+=p[j]
return s;
}
long Sum = sum(3,l,2,3);
【C代码 2】
static int pent;
……
void *MyMemcpy(void * dest, const void* src, int n )
{
char *pDest = (char *)dest;
char *pSrc = (char *)src;
for (int i=0;i<n; i++) {
*(pDest +i) = *(pSrc+i);
} return dest;
}
【C代码 3】
node *fun(node * head, int index)
{
node *ptr1,*ptr2;
int 1 = 0;
ptr1 = head;
ptr2 = head;
if(head == NULL || head->next == NULL)
return ptrl;
while(i<index)
{
(1)
if(ptrl == NULL)
return head;
i++;
}
while(ptrl->next != NULL)
{
ptrl = ptrl->next;
(2) ;
}
return (3) ;
}
node* ReverseList(node *head)
{
node *templ = NULL;
node *temp2 = NULL;
node *temp3 = NULL;
if((head->next == NULL) || (head == NULL))
{
return head;
} templ=head;
temp3= templ->next;
templ->next= NULL;
while(temp3->next!=NULL)
{
temp2 = temp3;
temp3= temp3->next;
(4) ;
templ=temp2;
}
temp3->next= templ;
retum (5)
}
【问题1】(3分)
执行【C代码 1】后,Sum的值应为多少?请用十进制表示。
【问题2】(7分)
请问【C代码2】中 static的作用是什么?const的作用是什么?王工自己编写的内存拷贝函数安全吗?
如存在缺陷,请指出缺陷在哪里。
【问题3】(5 分)
仔细阅读并分析【C代码 3】,填补其中的空(1)~(5)。
Many buildings ______ by the earthquake. (destroy)
A、as twice
B、twice as many
C、twice many as
D、twice many
A.many; many
B.much; much
C.a lot of; many
D.many; a lot of
A.as many twice
B.as twice many
C.twice many as
D.twice as many
A、many designers
B、many clothes
C、many museums
D、shops
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!