B語言
维基百科,自由的百科全书
(重定向自B语言)
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'); }
[编辑] 參見
[编辑] 外部鏈接
|
|||||||||||||||||||||||||||||||||||||||