The powerful GCC compiler in C
The GNU Gcc C compiler is the application that, by means of a set of C code files, generates an executable program.
The gcc compiler is one of the most powerful and fastest compilers in the course of time. In its history, there are two standards such as C99 and C11. The most recent standard was presented in 2011 and its last registered version is 9.3 to have more compatibility with programming languages.
Version
To view the version you have installed, run the following …
You will have the following result:
Handbook
Gcc has its own manual to be able to view in detail each command that is executed. Run the following command in the terminal:
You will have the following result:
Gcc compilation with C language:
Gcc is not just a native compiler, it can also cross-compile any program. It is written in C with a strong focus on portability and can compile itself. An Introduction to GCC (davidam.com)
Let’s do a couple of examples:
We are going to make two types of simple code in C and demonstrate how Gcc compiles
First example:
When saving the file with the code, we execute the command (gcc -o “Program name”), otherwise, the gcc creates a default name “a.out”.
As shown, the Hello world program was created using the gcc compiler.
Execute the program using the command “./Hello_world” which will return the following result:
Second example:
We compile the code without placing a name so that it generates one by default “a.out”.
Once the code is compiled, we run the program “./a.out” and, as shown, it shows numbers from 0 to 5.