Member-only story
Compiling
Compiling is the process of transforming a high-level language into a low-level language. A high-level language is closer to English. A low-level language is closer to what the computer understands.
Compiling a C Program
Compiling is the transformation from source code (human-readable) into machine code (computer-executable). A compiler is a program. A compiler takes the recipe (code) for a new program (written in a high-level language) and transforms this code into a new language (machine language) that can be understood by the computer itself. This "machine language" is difficult to impossible for humans to read and understand (much less debug and maintain), thus the need for "high-level languages" such as C.
The compiler also ensures that your program is TYPE correct. For example, you are not allowed to assign a string to an integer variable!
The compiler also ensures that your program is syntactically correct. For example, "x * y" is valid, but "x @ y" is not.
The compiler does not ensure that your program is logically correct.
The compiler we use is the GNU (Gnu is not Unix) Open Source compiler.
G++ is the name of the compiler. (Note: G++ also compiles C++ code, but since C is directly compatible with C++, we can use it.).
To compile a program, you use the following command:
This command can be written in the Linux command window or can be typed in using Emacs's compile command.