C language compiler, the magic of magician

We usually say the program, refer to the program can be run directly after the double-click, this program is called executable program (Executable Program). Under Windows, the suffix executable programs have .exe and .com (which .exe more common); under UNIX-like systems (Linux, Mac OS, etc.), the executable program is not the head of a particular suffix, according to the file system information to determine whether it is an executable program.

Internal executable is a collection of computer instructions and data, which are in binary form, the CPU can be directly identified, there is no obstacle; but for programmers, they are very obscure, it is difficult to remember and use.

For example, the output of "VIP members" on the screen, written in C as follows:

puts ( "VIP Members");

Binary wording is:


You feel, use the binary is not to hit the wall, is not subject to a ton of injuries?

In the early days of computer development, the programmer is to use such a binary instructions to write a program, that pioneering era has not programming language.

Use the binary instruction program for programmers is simply a nightmare, especially when the procedure is relatively large, not only to write cumbersome, requiring frequent query instruction manual, and debugging will be extremely distressed to directly face a bunch of binary data, so people get confused. In addition, complicated steps binary programming instructions, to consider various boundary conditions and the underlying problem, the development efficiency is very low.

This Forced programmers developed a programming language, improve their productivity, for example, are gradually improving development efficiency assembler, C language, C ++, Java, Python, Go language. So far, the program finally is no longer only a geek can do, and readers do not understand the computer after a certain amount of training can also write a kind of mold programs.

What is the compiler

C language code by a fixed vocabulary organized according to a fixed format it simple and intuitive, easy to identify and understand the programmer, but for the CPU, C language code is bible, did not know, only know the CPU hundreds of instructions in binary form. This requires a tool to convert C code into a binary language instruction of the CPU can be recognized, i.e. processed into .exe program code; this is a special software tool, called a compiler (Compiler).

The compiler recognizes the code words, sentences, and a variety of specific formats, and convert them into a binary form of a computer can be identified, a process called compiled (Compile).

Compiler can also be understood as "translation", similar to the Chinese translation into English, will be translated into English hieroglyphics, it is a complex process, generally including lexical analysis, syntax analysis, semantic analysis, performance optimization, generate executable file five It involves steps during the complex algorithms and hardware architectures. For students to learn computer or software, "compiler theory" is a professional course, interested readers read their own "compiler theory," a book, to explain where we are no longer expand.

Note: do not understand the compiler theory does not affect our learning C language, I do not recommend beginners to delve compiler theory, bite off more than you can chew, do not put yourself into it around.

C language compiler there are many different compiler for different platforms, such as:

  • Microsoft Windows is under common development  cl.exe , it is integrated in Visual Studio or Visual C ++, in general, is not alone;
  • Under common GUN Linux is developed by  GCC , many Linux distributions comes with GCC;
  • Mac is under common  LLVM / Clang , it is integrated in Xcode (Xcode integration is the former GCC, GCC does not fit due later was changed LLVM / Clang, LLVM / Clang performance is more powerful than GCC).


Your code syntax is correct or not, the compiler say considered, we learn the C language, in a sense, that is to learn how to use the compiler, so that the compiler generates an executable program (for example .exe program under Windows).

The compiler can 100% guarantee that your code from grammatically correct, because even if there is little wrong, the compiler can not pass, the compiler will tell you where wrong, to facilitate your change.

What is the Integrated Development Environment

The actual development, in addition to the compiler tool is a must, we often need a lot of other supporting software, such as:

  • Editor: to write code to the code and colored to facilitate reading;
  • Code Reminder: an input section of code, the system will prompt all the code, to accelerate the process of writing the code;
  • Debugger: observation of each run program step, the program logic error was found;
  • Project management tools: all resources related to the program management, including source files, pictures, videos, and other third-party libraries;
  • Beautiful interface: various buttons, panels, menus, windows and other controls neatly arranged, the operation more convenient.


These tools are often packaged together, unified distribution and installation, such as Visual Studio, Dev C ++, Xcode , Visual C ++ 6.0, C-Free, Code :: Blocks , etc., which are collectively referred to as the integrated development environment (IDE, Integrated Development Environment).

Integrated Development Environment is a combination of a series of development tools suite. It's like a desktop, a core component of the desktop is the host, the host will be able to work with an independent, but when we buy a desktop, but also often included with the monitor, keyboard, mouse, U disk, video cameras, peripherals because only hosts too inconvenient, you must have peripheral to play cool.

Integrated development environment is the reason, only the compiler is not convenient, so also add other aids.

Guess you like

Origin www.cnblogs.com/Q674327382/p/11316958.html