Compiler And its Requirement For C Or C++

In this article we will learn about Source Code, Object Code, Byte Code, Machine Code, What is Compiler, What is the requirement of compiler And Work Of Compiler. 

We will Discuss About the Definition Of Source Code, Definition Of Object Code, Definition Of Machine Code, Definition Of ByteCode
We will Understand that What is a Compiler and Why we need a Compiler to Develop Any Software or Website.


Before discuss about Compiler lets talk about some terms which are related with compiler.

Machine Code: Machine codes are set of instructions which is directly executable (without any translation)  by the computer's physical processor. But the problem with machine code is it is not portable that means machine code for every machine may be different. If a program is written in machine code on a specific machine then it will not execute on another machine, And machine language is not a easy language like C, C++ or Java.

Byte Code: Byte Codes are that codes which can be executed by a virtual machine. It is slower than Machine Codes but is portable across platform, that means a Byte Code written on a specific machine can be execute and produce same output on any machine or any Operating Systems.
To Know More About Byte Codes Please Read   Introduction To Java

Object Code: Object codes are that codes which are generated by Compiler and are containing  machine codes or Byte Codes or combination of both. That are used to produce executable file. That codes are combined with additional meta data like library files and generate executable code.

Source Codes: Source codes are set of instructions in human readable form. which is used to generate object codes and machine code, like codes in C, C++ or Java. It is easy to learn. 

Compiler:

we know that a computer can understand only machine language but it is too difficult to learn machine language and it is also machine dependent language.

 We learn a easy language like C or C++, but computer can not understand it directly, so it is required to convert the C or C++ code into machine code which is understable by computer.

A compiler is a program (software) that translate a source program which is written in a high level language (such as C, C++ or Java) into machine language. Compiler compiles the whole source code and convert them into object code, later on  the object code is  converted into executable code by combining library files, it also shows syntax errors.

Compiler

In other words you can say that compiler is a software which take source file as its input and produce object and executable file as its output.

C or C++ is a platform dependent language that mean the object code of C or C++ which is generated by a operating system can't execute on another operating system.

For Example: if you write a program on windows operating system and compile it to get an executable file then the executable file will only run on the machines which have windows operating system, if you want to execute the program on another operating system then you have to compile the source code on that operating system.

so there are different different compilers for different different operating systems. 
 There are many compilers are available in market for C or C++, like Turbo C++, Dev C++, Codeblocks.

You Can Download Codeblocks From: http://www.codeblocks.org

Also Read: Introduction To C | Introduction To C++

Conclusion: 

So we learnt about what is source file, what is object file, what is byte code, what is machine code, what is compiler And why compiler is required. 


- Also Read: Features Of C | Variable And Data Types In C



Thank You !!

Tags: What is Source Code, What is Object Code, What is byte code, what is machine code, what is compiler, source file, object file, byte code, machine code, compiler, need of compiler, Requirement of compiler, Advantage of Compiler, Disadvantage of Compiler, Importance Of Compiler