TAILIEUCHUNG - A Complete Guide to Programming in C++ part 82

A Complete Guide to Programming in C++ part 82. This book provides both novice and experienced programmers with a comprehensive resource manual for the C++ programming language. Readers gain experience in all aspects of programming, from elementary language concepts to professional software development, with in depth coverage of all the language elements en route. These elements are carefully ordered to help the reader create useful programs every step of the way. | PREPROCESSOR DIRECTIVES Example include iostream include if VERSION 1 define MYPROJ_H else define MYPROJ_H endif include MYPROJ_H The if elif else and endif Directives You can use the if elif and endif directives to compile certain parts of a source file and ignore others. The directives are known as conditional compilation directives for this reason. Syntax if expressionl textl elif expression2 text2 elif expression n text n else text n 1 endif Each if directive must be terminated by an endif directive. Multiple elif directives can occur in between. The else directive can occur once only. The preprocessor evaluates expressionl expression2 . in sequence. If an expression that yields true is found that is its value is not 0 the corresponding code for this expression is processed. If none of these expressions is true the else directive is executed. If this directive is omitted no corresponding code is processed. expressionl expressionl . must be constant expressions of integral types and cannot contain the cast operator. Some compilers do not allow the use of the sizeof operator. The corresponding text is a source text that is it comprises preprocessor directives C statements or whole C programs. When a corresponding text is processed the preprocessor may first execute directives before passing the expanded source code to the compiler for compilation. Code that the preprocessor has not processed is removed from the source. 790 APPENDIX The defined Operator You can use the defined operator to check whether a symbolic constant or macro has been defined. Syntax defined name The operator returns a value other than 0 if valid definition for name exists and the value 0 in all other cases. A definition created using the define directive remains valid until it is removed by an undef directive. If the substitute text following name in the define directive is missing the definition is still valid. The defined operator is normally used in if or .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.