Answer the question
In order to leave comments, you need to log in
Source, Machine and Object Codes - Difference?
In C++ . Describe as clearly as possible what is the difference between these three concepts. Examples are welcome.
Answer the question
In order to leave comments, you need to log in
Source code or source code is text in a programming language that is written by a person (usually a person). This is a plain text file (usually).
But the processors in computers/smartphones, etc. are rather dumb devices that can only understand extremely simple machine code.
Therefore, any program is directly or indirectly converted from source code into machine code, and only after that it is executed by a computer / smartphone, etc.
Object code is an intermediate representation of the code. Still not machine, but not the original. Used at the stage of assembling a program from several pieces (possibly written in source code by different people and at different times).
Machine code - ready for execution. That is, just take it, nothing more is needed. Do a double-click, for example, and the program starts.
Source code example - easy:
package example
func Add(p int) int {
return p + p
}
!<arch>
__.PKGDEF 0 0 0 644 30328 `
go object windows 386 go1.11 X:framepointer
build id "ZKpaYf_Flzmm6jns9NJp/RbNW-F32vdlI8SgqpfEX"
----
$$B
i
Source - the source code of the program
Object - intermediate modules for assembly and linking into machine code
Machine - assembled object into executable instructions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question