1 : First Program in C Plus Plus (prepare) -VillageProgrammer.tech

First Program in C Plus Plus

First of all the program is translated into the machine-understandable language i.e. Machine Language or Binary Language. 

Translating C++ program :

Translating C++ program - villageprogrammer.tech

Procedure :



The following three steps are required to create and translate a C++ program:
  1. First, a text editor is used to save the C++ program in a text file. In other words, the source code is saved to a source file. In larger projects, the programmer will normally use modular programming. This means that the source code will be stored in several source files that are edited and translated separately
  2. The source file is put through a compiler for translation. If everything works as planned, an object file made up of machine code is created. The object file is also referred to as a module.
  3. Finally, the linker combines the object file with other modules to form an executable file. These further modules contain functions from standard libraries or parts of the program that have been compiled previously.
It is important to use the correct file extension for the source file’s name. Although the file extension depends on the compiler you use, the most commonly found file extensions are .cpp and.cc.

Prior to the compilation, header files, which are also referred to as include files, can be copied to the source file. Header files are text files containing information needed by various source files, for example, type definitions or declarations of variables and functions.

Header files can have the file extension .h, but they may not have any file extension.
The C++ standard library contains predefined and standardized functions that are available for any compiler. Modern compilers normally offer an integrated software development environment, which combines the steps mentioned previously into a single task. A graphical user interface is available for editing, compiling, linking, and running the application. Moreover, additional tools, such as a debugger, can be launched.





NOTE: 
If the source file contains just one syntax error, the compiler will report an error. Additional errormessages may be shown if the compiler attempts to continue despite having found an error. So when you are troubleshooting a program, be sure to start with the first error shown.

Post a Comment

Previous Post Next Post