tailieunhanh - C++_programming_guidelines

| C programming guidelines 1. Language independent rules . Unary operators Correct v --v -10 Wrong -- v - 10 . Binary operator Use always exactly one separating blank on the left and on the right side of a binary operator. Correct a b a - b a b a b a b a b a b a b a b a b a b a b a b a b a b a b c a b Wrong ỊU ỊU ỊU ỊU ỊU ỊU X- 1 II ư II II II O ứ ư ứ ư Q . Brackets There is no separating blank allowed between the outer brackets and the inner expression. Correct a b a - b a b Wrong a - b a - b a b . Statements and statement delimiters Only one statement per line is allowed. There is no blank between the statement and its statement delimiter. Correct a Wrong a a b . Indentation Tabulator characters are not allowed for indentation. Two space characters represent one indentation level. The indentation level is initialised with zero. Entering a block all statements between the and brackets increases this indentation level by one. . Font It is recommended to use a font with a fixed width like Courier. The C guidelines are optimised for such fonts. . Line length 100 characters is the maximum length of a line. Each single statement that is longer than 100 characters must be splitted into several lines. The indentation level of the first line is increased by two for all other lines. 2. Control structures Do not use the following statements Continue Break only allowed for the termination of a switch case Goto The correct formatting of the control structures is described by EBNF syntax in the following sections. Additionally two important breaking rules must be defined. Statements line must be broken at the start of a new parameter if the line is too long. If this rule fails the breaking rule of expressions must be applied. When the expression rule also has failed the break should be made at a place which looks good for the programmer. The indentation level of each new line is increased by two. This means four additional indentation characters at the .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
19    229    0    29-04-2024
46    187    0    29-04-2024
23    157    0    29-04-2024
10    118    0    29-04-2024
1    114    1    29-04-2024
crossorigin="anonymous">
Đã 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.