Introduction To C Prog.
Introduction To C Prog.
Introduction To C Prog.
PROGRAMMING IN C
Compiler
Source Code Object Code
Interpreter
1
BCCA Sem-I Programming in C 2020-21
Compiler
To start with, a compiler creates the program. It will analyze all the language
statements to check if they are correct. If it comes across something incorrect, it
will give an error message. If there are no errors spotted, the compiler will convert
the source code into machine code. The compiler links the different code files
into programs that can be run such as exe. Finally the program runs.
Interpreter
An interpreter creates the program. It neither links the files nor generates machine
code. The source statements are executed line by line while executing the
program.
Difference Between
Interpreter translates just one statement Compiler scans the entire program and
of the program at a time into machine translates the whole of it into machine
code. code at once.
An interpreter takes very less time to A compiler takes a lot of time to
analyze the source code. However, the analyze the source code. However, the
overall time to execute the process is overall time taken to execute the
much slower. process is much faster.
An interpreter does not generate an A compiler always generates an
intermediary code. Hence, an intermediary object code. It will need
interpreter is highly efficient in terms further linking. Hence more memory is
of its memory. needed.
2
BCCA Sem-I Programming in C 2020-21
What is C programming?
C was the basic language to write everything from operating systems (Windows
and many others) to complex programs like the Oracle database, Git, Python
interpreter and more.
It is said that 'C' is a mother of all programming languages. One can say, C is a
base for the programming. If you know 'C,' you can easily grasp the knowledge
of the other programming languages that uses the concept of 'C'
History of C language
4
BCCA Sem-I Programming in C 2020-21
Nowadays, various compilers are available online, and you can use any of those
compilers. The functionality will never differ and most of the compilers will
provide the features required to execute both 'C' and 'C++' programs.
Summary