tailieunhanh - the ansi c programming phần 10
Phát triển khởi đầu của C xảy ra ở AT&T Bell Labs giữa 1969 và 1973; theo Ritchie thì thời gian sáng tạo nhất là vào năm 1972. Nó được đặt tên là C vì nhiều đặc tính của nó rút ra từ một ngôn ngữ trước đó là B. Thêm vào đó, các điểm khác với ngôn ngữ nguyên thủy "B": Ken Thompson kể tới ngôn ngữ lập trình BCPL, nhưng ông ta cũng đã tạo ra ngôn ngữ là Bon để vinh danh vợ mình. | 190 Each of the directives if-line elif-line else-line and endif appears alone on a line. The constant expressions in if and subsequent eiif lines are evaluated in order until an expression with a non-zero value is found text following a line with a zero value is discarded. The text following the successful directive line is treated normally. Text here refers to any material including preprocessor lines that is not part of the conditional structure it may be empty. Once a successful if or eiif line has been found and its text processed succeeding eiif and eise lines together with their text are discarded. If all the expressions are zero and there is an eise the text following the eise is treated normally. Text controlled by inactive arms of the conditional is ignored except for checking the nesting of conditionals. The constant expression in if and eiif is subject to ordinary macro replacement. Moreover any expressions of the form defined identifier or defined identifier are replaced before scanning for macros by 1L if the identifier is defined in the preprocessor and by 0L if not. Any identifiers remaining after macro expansion are replaced by 0L. Finally each integer constant is considered to be suffixed with L so that all arithmetic is taken to be long or unsigned long. The resulting constant expression is restricted it must be integral and may not contain sizeof a cast or an enumeration constant. The control lines ifdef identifier ifndef identifier are equivalent to if defined identifier if defined identifier respectively. eiif is new since the first edition although it has been available is some preprocessors. The defined preprocessor operator is also new. Line Control For the benefit of other preprocessors that generate C programs a line in one of the forms iine constant filename iine constant causes the compiler to believe for purposes of error diagnostics that the line number of the next source line is given by the decimal integer constant
đang nạp các trang xem trước