Creating, Compiling, and Executing a C++ Program: A Step-by-Step Guide, Assignments of Programming Languages

Learn the detailed process of creating, compiling, and executing a c++ program. From writing the code in a text editor and saving it with a .cpp extension, to the preprocessor, compiler, linker, and executable file. Understand the role of header files and library files in the process.

Typology: Assignments

2019/2020

Uploaded on 11/14/2020

unknown user
unknown user 🇲🇾

5 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1. Explain the detailed steps of creating, compiling, and executing a C++ program.
1. Type a c++ program in a text editor and save the file name with a .cpp extension.
2. The preprocessor processes the program before compilation. Preprocessor process
header files such as iostream and cmath.
3. Compile your program using a compiler. This process converts the source code to an
object code which is understandable by the machine. The object code usually has the
same name as the source code but with a different extension. The extension of the
object code is .obj.
4. Then the linker links the program, this creates an executable file .exe (filename same
as source code) after linking the object code and the library files (header files)
required for the program.
5. Finally, run the executable file. In this step, the statements in the program will be
executed one by one.

Partial preview of the text

Download Creating, Compiling, and Executing a C++ Program: A Step-by-Step Guide and more Assignments Programming Languages in PDF only on Docsity!

  1. Explain the detailed steps of creating, compiling, and executing a C++ program.
    1. Type a c++ program in a text editor and save the file name with a .cpp extension.
    2. The preprocessor processes the program before compilation. Preprocessor process header files such as iostream and cmath.
    3. Compile your program using a compiler. This process converts the source code to an object code which is understandable by the machine. The object code usually has the same name as the source code but with a different extension. The extension of the object code is .obj.
    4. Then the linker links the program, this creates an executable file .exe (filename same as source code) after linking the object code and the library files (header files) required for the program.
    5. Finally, run the executable file. In this step, the statements in the program will be executed one by one.