The secret behind the success of 48-year-old C language, C language actually has a kind of trick? !

▏C language preface ▏

       Since the development of computer programming languages ​​are endless, but no matter how many "new" crest out, they can not change in the C programming language highly respected position in the community.

       C language in the end to do the many things? We often say that the Linux operating system kernel is written in C language, corresponding to many embedded kernel driver is also not running C language category, including all common mobile phones, set-top boxes, televisions underlying hardware drivers are basically C language carry out.

       It is no exaggeration to say that if there is no C language, there is no Windows 10 and Microsoft's Surface Book, nor Andrews smart phones, not Steve Jobs of Apple empire created a variety of products MAC, iPad.

       C language where the cattle, now almost all of the underlying language of most of the top languages ​​are C language brother do the wedding dress to pave the way complete. A deep understanding of the upper underlying implementation language, C language can not be separated. And many universities specializing in computer language C will put students in introductory programming as a first step. Therefore, many programmers to learn C language regarded as the most basic things in life program.

       The C language Why can become one of the most important and most popular programming language, the advantage of this question stand out from Stephen Plata in the "C Primer Plus Sixth Edition" to give us a summary of the many C language in it be able to get an answer.

▎ design features 

C language combines the control characteristics of computer science theory and practice. C language design allows users to easily complete top-down planning, structured programming and modular design. Therefore, the program written in C language more understandable and more reliable.

▎ efficiency

In the design, it makes full use of the advantages of the current computer, and therefore relatively compact C program, and run fast

▎ portability 

C is a portable language. This means that, in a system written in C minor or no modification program can run in other systems. To change, also simply change the main header file can be a little item.

▎ powerful and flexible 

C language is powerful and flexible. Powerful and flexible UNIX operating systems, most of which are written in C language. C programs can also be used to solve problems in physics and engineering, and even be used to make a movie of animation effects.

▎ for programmers 

C language is designed to meet the needs of programmers and design, C programmers can use to access the hardware, manipulate bits in memory. C language has a wealth of operators, allowing programmers to concisely express their intentions.

       This 7-step how to use it?

 Target definition program: Step 1

       Main point is that in the hands before writing the program, to have a clear idea in mind. What program do you want first of all they have to know exactly what you want to do, think about what information your program needs, which calculate and control to be carried out, and what procedures should be reported information.

 Step 2: Design program

       After the program has a conceptual understanding of what tasks should be completed, you should consider how to use the program to accomplish it. For example, the user interface should be like? How to organize the program? Who target users? Ready to spend more time to complete this program? In addition, the need to decide how to represent data, and in what ways such as processing data in the program.

 Step 3: Coding

       After designing a good program, you can write code to implement it. In other words, designed to translate your program into the C language. In general, use a text editor to create source code files. The contents of the file that you translated C code.

 Step 4: Compile

       Everyone should know, C compiler is responsible for translating C code into machine-specific language. In addition, C compiler and also the C library source code merged into the final program. As a result, a user can generate an executable file to run, which contains the code that the computer can understand. The compiler also checks the C language program is valid. If the C compiler finds errors, it does not generate an executable file with an error.

 Step 5: Run the program

       In a common environment, run the program you want to enter the file name of the executable file, and other environments may want to run a command or some other mechanism. For example, in Windows and Macintosh provides an integrated development environment (IDE), the user can select the menu options in the IDE or press special keys to edit and execute C programs. Ultimately resulting program can be run directly in the operating system by clicking or double-click the file name or icon. 

 Step 6: Test and debug programs 

       Program run is a good sign, but sometimes run error may occur. Next, check whether the program should be run along the lines of your design. You will find that your program has some bug, may ignore the input checking program leading to paralysis, may put parentheses misplaced, might misuse the C language or the wrong word, and so on.

 Step 7: maintain and modify the code 

       After creating the program, you find that the procedure is wrong, or you want to use the extension, then we should modify the program. For example, when the user enters the name to begin with Zz program error occurs, you think of a better solution, or to modify the program so that it can run on different computer systems and so on. If you made a comment and clearly using rational design program at the time of writing, these things are simple.

       For those who love programming, there are a group of small partners together to learn is very important! If you are interested or in need, then we have a zero-based introductory programming learning exchange clubs , as well as learning video files, are welcome beginners and advanced in little friends!

Published 520 original articles · won praise 132 · views 80000 +

Guess you like

Origin blog.csdn.net/HUYA69/article/details/105178032
Recommended