Lect 4 Programming Logic Using ‘C’ Compilation Process of C Program
Lect 4 Programming Logic Using ‘C’ Compilation Process of C Program
BCAC0001
Lect-4 Compilation Process of C program
Presented by:
Atul Kumar Uttam
Assistant Professor
Computer Engineering & Applications Department,
GLA University, Mathura
atul.uttam@gla.ac.in, +91-8979593001
Compilation process in c
• Compilation
– process of converting source code in to machine code (binary 1’s and
0’s)
• CPU can understand and execute only machine code.
https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html
BCAC0001 Programming Logic Using C
Atul Kr Uttam
1. Preprocessing
• The preprocessor obeys commands that begin with # (known
as directives) by:
– removing comments
– expanding macros
– expanding included files
• #include <stdio.h>
– it will look for the stdio.h file and copy the header file into the source
code file.
• The preprocessor also generates macro code and replaces
symbolic constants defined using #define with their values.
$ gcc hello.c
$ ./a.out
Hello, world!