B语言


B语言 (正體)

Free Web Hosting with Website Builder

B 语言是一种通用的程序设计语言。自从被C 语言取代之后,它几乎已遭弃置。B 语言大约是于1969年时由美国贝尔实验室计算机科学家──肯·汤普森丹尼斯·利奇的支持下设计出来的。后来,丹尼斯·利奇以 B 语言为基础开发出 C 语言,至此 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