The powerful GCC compiler in C

giuliano flores mesias
3 min readJun 22, 2021

--

architecnologia.es — 2019

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:

Print a text string.

When saving the file with the code, we execute the command (gcc -o “Program name”), otherwise, the gcc creates a default name “a.out”.

Compile Hello.c file

As shown, the Hello world program was created using the gcc compiler.

Hello_world program was created

Execute the program using the command “./Hello_world” which will return the following result:

The program executed

Second example:

Print Numbers 0 to 5

We compile the code without placing a name so that it generates one by default “a.out”.

Compiled code

Once the code is compiled, we run the program “./a.out” and, as shown, it shows numbers from 0 to 5.

Compiled code

--

--

giuliano flores mesias

I have the dream of making a digital transformation to my 🇵🇪. I am a systems engineer and a software engineer