Compilation in .c : What happens when you type gcc main.c?

Components of Compiler
  1. Preprocessor: Remove comments and include header files in source code, replace macro name with code

gcc

What is gcc?

How we can use gcc?

gcc - - help
manual that will appear when you use gcc — — help

Examples:

  1. You want run ony the preprocessor for the file test.c
  • First go to your manuall (gcc - - help) and search the option to preprocessor (-E)
  • Then use with gcc
gcc -E test.c
  • Again, search in your manual and you will find “-o” . So add your “-o” before of the file that you want to apply. In this case, before “result” because, you want to create this file
gcc -E test,c -o result
Advanced problem of the day: 101-quote.c
gcc -Wall 101-quote.c
./a.out

--

--

--

Software engineer in progress

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Programming and Writing Are Analogous

Download PPSSPP Gold : Windows Computer PC, Android & iOS

POWER BI —Direct Query on Clustered Columnstore Index

Day 4 of 21_days_of_challenge

The Defenition Of A Senior Developer

Dajngo with Nginx, Gunicorn

Request flow of Django with Gunicorn and Nginx as a reverse proxy.

What’s new in Refined GitHub

Acceptance criteria

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Katherine Soto

Katherine Soto

Software engineer in progress

More from Medium

Why Object-Oriented Programming OOPs?

What Programming Skill Is Currently in Demand

C Programming Language Algorithm Examples/Exercises

Setup up environment for C Programming