First of all, what is gcc? If we want to know What happens when you type gcc main.c, we need to know the base of all, gcc
GCC stands for GNU Compiler Collection (produced by the GNU - G nu is N ot U nix), that the name say, is a set of compilers for various languages. It provides all the infrastructure for building a entire software, like a front-end builder.