C + + Summary (2)--Program execution process

Source: Internet
Author: User

A program goes through the following steps from writing to finally getting the results of the run.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5A/07/wKiom1Tz_3qh44b4AABPc5fUnQs759.jpg "title=" 1.png " alt= "Wkiom1tz_3qh44b4aabpc5funqs759.jpg"/>


1. Write programs in C + + language

Programs written in high-level languages are called "source programs". The source program for C + + is suffixed with. CPP (CPP is the abbreviation for C Plus plus).


2. Compiling the source program

In order for a computer to execute a high-level language source program, it must first translate the source program into a binary form of "Object program " using a software called "Compiler (Complier)" (also known as a compiler or compilation system).

The compilation is compiled in the source program file as a separate unit. Target programs generally use . obj or . o as the suffix (an abbreviation for object). The role of compilation is to perform lexical and grammatical checks on the source program. All content in the file is checked at compile time, and all compilation error messages are displayed when the compilation is finished. There are two kinds of error messages in the general compiling system, one is error and the other is warning (warning).


3. Connect the target file

When all errors are corrected and all are compiled, one or more target files are obtained. At this point, the system-provided "connector (linker)" To all the target program of a program and the system's library files and other information provided by the system to connect together , and eventually form an executable binary file, its suffix is. exe, can be directly executed.


4. Running the program

Run the resulting executable binary (. exe file) and get the result.



This article is from the "Summer Wind" blog, please be sure to keep this source http://shahdza.blog.51cto.com/2410787/1616464

C + + Summary (2)--Program execution process

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.