B语言


B语言 (正體)

B语言是一种通用的程序设计语言。自从被C语言取代之后,它几乎已遭弃置。B语言大约是于1969年时由美国贝尔实验室的电脑科学家肯·汤普森丹尼斯·利奇的支持下设计出来的。后来,丹尼斯·利奇以B语言为基础开发出C语言,目前世界上最常用的程式语言之一。

例子

这是肯·汤普森提供的一个代源码:

/* The following function will print a non-negative number, n, to
  the base b, where 2<=b<=10,  This routine uses the fact that
  in the ASCII character set, the digits 0 to 9 have sequential
  code values.  */

printn(n,b) {
        extrn putchar;
        auto a;

        if(a=n/b) /* assignment, not test for equality */
                printn(a, b); /* recursive */
        putchar(n%b + '0');
}

参见

  • BCPL语言
  • C语言
  • 支援头文字

外部链接



! __







Why are we here?
All text is available under the terms of the GNU Free Documentation License
This page is cache of Wikipedia. History