Difference between Compiler and Interpreter, Assembler in Computer
C Program Structure >> Executing C Program >>
C Language Compiler - compiled code read by an Assembler
A Compiler translates the complete source program (written code) into machine-specific assembly language code (object code), which is then converted to machine code by an assembler. A compiler can read the complete source code, convert it into the assembly code and produce the error report, if any, to the user. A compiler takes a small amount of time for converting source code to object code. C and C++ languages uses a compiler to convert C/C++ language source code (.c or .cpp file) into an executable (.exe) file
C Program - does not need Interpreter
The interpreter directly executes the code line by line. Input to the interpreter can be a language code like BASIC or LISP. In other cases, it can be bytecode like in Java. In the case of a language like BASIC, No conversion to machine language is done. Since the interpreter directly executes, even syntax errors are thrown at runtime only and then the program stops. In the case of Java, a compiler compiles the code and indicates all the errors. Once the programmer/coder/developer fixes the errors, the bytecode is generated in a file with extension .class. In the case of C, we do not use an interpreter.
Assembler
An assembly language program is not portable. Program developed for one type of machine does not work on another type of machine. Hence, a C Language assembler is available separately for each platform.
Before understanding C programming, it is necessary to understand why C language was created. C is a programming language which made creating software much easier compared to using assembly language.