Home  >  Article  >  Backend Development  >  What does formatted code mean?

What does formatted code mean?

藏色散人
藏色散人Original
2019-06-03 14:36:158795browse

When you enter or automatically generate code in the source code editor, the code will be formatted in certain ways. This process is called formatting code.

What does formatted code mean?

Formatting code in C

Many people do not pay attention to the layout structure of the program when writing programs. Affects the function of the program, but the readability of the program will be greatly reduced.

The format of the C language is very free, which means that whitespace such as newlines, spaces, blank lines, and tabs will be ignored when the program is running. Programmers can use whitespace to indent or indent the code in a specific style. separated to make the program clearer and easier to understand.

Using indentation can make the program clearer. There are many indentation styles, and programmers can choose any style for indentation according to their own habits. There are two commonly used styles. The first is to align the braces and conditional statements and indent the statements within the braces.

Examples are as follows:

   if(a > b)
   {
   t= a;
   a=b;
   b=t;
   }

The second is to place the opening brace after the conditional statement, and the closing brace is aligned with the conditional statement and indented the statement within the braces.

Examples are as follows:

    if(a > b){
   t=a;
   a=b;
   b=a;
   } [1]

The above is the detailed content of What does formatted code mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn