题目内容 (请给出正确答案)
[单选题]

一C源程序文件中包含如下函数: char test(char point ) { switch(point ) { case 'A': return ...; case 'B': return ...; case 'C': return ...; ...更多跳转分支... } } 在IA-32+Linux+GCC平台上,假设GCC使用跳转表在机器级表示与实现该switch语句控制结构,进一步对相应可执行程序使用objdump进行反汇编,得到test函数的机器级指令序列如下(指令左侧为指令所在起始地址): 8049152 <test>: 8049152: push %ebp 8049153: mov %esp,%ebp 8049155: sub $0x4,%esp 8049158: mov 0x8(%ebp),%eax 804915b: mov %al,-0x4(%ebp) 804915e: movsbl -0x4(%ebp),%eax 8049162: sub $0x41,%eax 8049165: cmp $0x5,%eax 8049168: ja 804919d 804916a: mov 0x804a008(,%eax,4),%eax 8049171: jmp *%eax 8049173: mov $0x64,%eax 8049178: jmp 80491a2 804917a: mov $0x5a,%eax 804917f: jmp 80491a2 8049181: mov $0x50,%eax 8049186: jmp 80491a2 ...更多机器指令... 80491a2: leave 80491a3: ret 已知字符'A'的ASCII编码是0x41。该switch语句对应的跳转表中最少应包含多少个表项?()

A.4

B.5

C.6

D.7

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“一C源程序文件中包含如下函数: char test(char…”相关的问题

第1题

有如下程序: #include<iostream> using namespqce Std; class TestClass { private; Char C; public; TestClass(char n):c(n){} ~TestClass() { cout<<c; }; class TestClassl:public TestClass { private: Char C; public:

A.xy

B.yx

C.x

D.y

点击查看答案

第2题

Which of the following pie charts does the man refer to?

A.

B.

C.

点击查看答案

第3题

已知程序中已经定义了函数test,其原型是int test(int,int,int);,则下列重载形式中正确的是

A.char test (int,int,int);

B.double test(int,int,double);

C.int test(int,int,int=O);

D.float test(int,int,float=3.5F);

点击查看答案

第4题

有如下程序: #included<iostream> usingnamespqcestd; classTestClass { private; charC; public; TestClass(charn):c(n){} ~TestClass() { cout<<c; } }; classTestClassl:publicTestClass { private: charC; public: TestClassl(charn):TestClass(n+1),c(n){}~TestClassl() { cout<<c; } }; intmain() { TestClasslobj('X'); return0; } 执行上面的程序将输出( )。

A.xy

B.yx

C.X

D.y

点击查看答案

第5题

有如下程序: #included<iostream> usingnamespqcestd; classTestClass { private; charC; public; TestClass(charn):c(n){} ~TestClass() { cout<<c; } }; classTestClassl:publicTestClass { private: charC; public: TestClassl(charn):TestClass(n+1),c(n){}~TestClassl() { cout<<c; } }; intmain() { TestClasslobj(X); return0; } 执行上面的程序将输出( )。

A.xy

B.yx

C.X

D.y

点击查看答案

第6题

阅读以下说明和C程序,填补代码中的空缺(1)~(5),将解答填入答题纸的对应栏内。 【说明】 函数areAnagrams(char *fstword, char *sndword)的功能是判断fstword和sndword中的单词(不区分大小写)是否互为变位词,若是则返回1,否则返回0。所谓变位词是指两个单词是由相同字母的不同排列得到的。例如,“triangle”与“integral”互为变位词,而“dumbest”与“stumble”不是。 函数areAnagrams的处理思路是检测两个单词是否包含相同的字母且每个字母出现的次数也相同。过程是先计算第一个单词(即fstword中的单词)中各字母的出现次数并记录在数组counter中,然后扫描第二个单词(即sndword中的单词)的各字母,若在第二个单词中遇到与第一个单词相同的字母,就将相应的计数变量值减1,若在第二个单词中发现第一个单词中不存在的字母,则可断定这两个单词不构成变位词。最后扫描用于计数的数组counter各元素,若两个单词互为变位词,则counter的所有元素值都为0。 函数areAnagrams中用到的部分标准库函数如下表所述。

【C函数】 int areAnagrams (char *fstword, char *sndword { int index; int counter [26]={0}; /* counter[i]为英文字母表第i个字母出现的次数,&39;A&39;或&39;a&39;为第0个,&39;B&39;或&39;b&39;为第1个,依此类推 */ if ( (1) ) /* 两个单词相同时不互为变位词 */ return 0; while(*fstword) { /* 计算第一个单词中各字母出现的次数 */ if (isalpha (*fstword)) { if (isupper (*fstword)) counter [*fstword -&39;A&39;]++; else counter [*fstword -&39;a&39;]++; (2) ; /* 下一个字符 */ } } while (*sndword) { if (isalpha (*sndword)) { index= isupper (*sndword) ? *sndword -&39;A&39;: *sndword -&39;a&39;; if (counter [index] ) counter [index] --; else (3) ; } (4) ; /* 下一个字符 */ } for (index = 0; index<26; index++) if ( (5) ) return 0; return 1; }

点击查看答案

第7题

已知程序中已经定义了函数test,其原型是int test (int,int,int);,则下列重载形式中正确的是( )。

A.char test(int, int, int);

B.double test (int,int,double);

C.int test(int ,int, int=0);

D.float test(int,int,float=3.5F);

点击查看答案

第8题

已知程序中已经定义了函数test,其原型是int test(int, int, int);,则下列重载形式中正确的是

A.char test(int,int,int);

B.double test(int,int,double);

C.int test(int,int,int=0);

D.float test(int,int,float=3.5F);

点击查看答案

第9题

已知程序中已经定义了函数test,其原型是int test(int,int,int);,则下列重载形式中正确的是______ 。

A.char test (int,int,int);

B.double test(int,int,double);

C.int test (int,int,int=0);

D.float test(int,int,float=3.5F);

点击查看答案

第10题

在窗体中添加一个命令按钮,编写如下程序: Private Sub Test(p,m,n) p=p+1:m=m+1:n=n+1 Print "Sub: ";p;m;n End Sub Private Sub Command1.Click() a1=1:b=2:c1=3 Call Test((a,b1+3,(c1)) Print "Main:";a1;b1;c1 End Sub 程序运行后,输出结果为

A.Sub: 2 6 4 Main: 2 6 4

B.Sub: 2 6 4 Main: 2 6 4

C.Sub: 2 6 4 Main: 1 2 3

D.Sub: 2 6 4 Main: 2 2 3

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信