1> goto 最强大,但一般只在特殊环境下使用。
2> if else
3> ?:
4> switch case
5> for
6> while
7> do while
自从dijkstra的论文Go To Statement Considered Harmful以后,C语言代码很少看到goto了。(一般用在多次资源分配的错误处理上)
但,从计算机的角度来说,缺少goto(jmp指令)还真没法干活。其实,goto是最符合我们的设计流程图的。
将一个流程图用goto来实现也最直观。goto能真正让我们做到心之所动,剑之所至。
接下来,分别考虑将2-7转化为对应的goto语言版本(等价于转化为对应汇编版本)。
2 if语句
if (条件1)
代码块1
else
代码块2
对应goto:
t = 条件1;
http://www.changsha.cn/bj/yl/xywy/2014/0329/546482.html
http://zx.zynews.com/hyzx/yskt/5231067716.html
http://www.js0573.com/yx/oxlx/3690509.html
http://www.lfxww.com/2014/shichangshangxun/2014/0329/750273.html
http://www.changsha.cn/bj/yl/zxjs/2014/0329/546491.html
http://www.fengone.com/bj/jsqy/2014/0329/439417.html
http://www.changsha.cn/bj/yl/xywy/2014/0329/546511.html
http://www.js0573.com/yx/oxlx/3693702.html
http://www.changsha.cn/bj/yl/xywy/2014/0329/546521.html
http://www.js0573.com/yx/oxlx/3693702.html
http://www.lfxww.com/2014/shichangshangxun/2014/0329/751169.html
http://www.js0573.com/yx/oxlx/3706451.html
http://www.changsha.cn/bj/yl/xywy/2014/0329/547467.html
http://www.lfxww.com/2014/shichangshangxun/2014/0329/751172.html
http://www.changsha.cn/bj/yl/zxjs/2014/0329/547475.html
http://www.js0573.com/yx/oxlx/3706449.html
http://www.changsha.cn/bj/yl/xywy/2014/0329/547476.html
http://www.lfxww.com/2014/shichangshangxun/2014/0329/751180.html
http://www.changsha.cn/bj/yl/xywy/2014/0329/547477.html
http://www.js0573.com/yx/oxlx/3706448.html
http://www.js0573.com/yx/oxlx/3706466.html
http://www.xyzc.cn/health/bjys/2014-03-30/1515581.html
http://zx.zynews.com/hyzx/yskt/5235746415.html
http://www.xyzc.cn/health/bjys/2014-03-30/1515587.html
http://zx.zynews.com/hyzx/yskt/5235741468.html
http://zx.zynews.com/hyzx/yskt/5235739371.html