博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

好好学习

  bilbo.cublog.cn

关于作者
姓名:你知道
职业:IT
年龄:每年大一岁
位置:地球
个性介绍:挺笨
Email: bilbo0214@163.com
|| << >> ||
我的分类


Dragon Book(2nd edition) Chapter1 Exercise

Exercise 1.6.1 : For the block-structured C code of Fig. 1.13(a), indicate the
values assigned to w, x, y, and z.
Ans.
w = 13, x = 11, y = 13, z = 11

Exercise 1.6.2 : Repeat Exercise 1.6.1 for the code of Fig. 1.13(b).
Ans.
w = 9, x = 7, y = 13, z = 11


Exercise 1.6.3 : For the block-structured code of Fig. 1.14, assuming the usual
static scoping of declarations, give the scope for each of the twelve declarations.
Ans.
-----------------------------------------------------
declaration           variable         scope
-----------------------------------------------------
int w, x, y, z;          w              B1 - B3 - B4
                         x              B1 - B2 - B4
                         y              B1 - B5
                         z              B1 - B2 - B5
int x, z;                x              B2 - B3
                         z              B2
int w, x;                w              B3
                         x              B3
int w, x;                w              B4
                         x              B4
int y, z;                y              B5
                         z              B5
-----------------------------------------------------

Exercise 1.6.4 : What is printed by the following C code?

Ans.
3
2

发表于: 2007-11-26,修改于: 2007-11-26 00:42,已浏览595次,有评论3条 推荐 投诉


网友评论
网友: nmap 时间:2008-01-11 12:46:01 IP地址:218.95.50.★
编译原理真难学懂,Bilbo,semantic这个词什么含义?

网友: bilbo0214 时间:2008-01-14 08:43:45 IP地址:218.249.16.★
semanitc 是“语义”的意思。

网友: nmap 时间:2008-01-15 19:28:02 IP地址:59.62.26.★
收到,在你这里学到很多计算机科学知识,谢谢你。

 发表评论