C ++ Program Execution Process

Source: Internet
Author: User

To understandProgramFirst, you must understand what is the compiler. We use C language programs. Computers can only recognize machine languages (binary commands) and computers cannot understand them. Therefore
Converts a C language to a machine language. The compiler is used to implement this function. The compiler willSource codeFiles are mapped to binary commands that can be recognized by computers according to certain rules.

 

Source files, target files, and executable files
Source File: Save the source fileCodeFile (*. C, *. cpp)
Target file: the compiler generates the target code based on the machine language instructions created in the source file. The disk file containing the target code is the target file.
It is generally a (*. OBJ) file and a (*. O) file in Linux.

The target file generated after the source code is compiled cannot be directly executed. Generally, all programs we write reference the basic library functions. Therefore, we need to replace the library functions with the defined target code before running the program. This process is called a link. It is to combine the source code's target file with the target file of the library function to generate the final executable file. The link is completed by the linker.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.