UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

The object file is in binary code, and the machine understands the binary language. So why object files are not executed?

Asked by Last Modified  

Follow 5
Answer

Please enter your answer

IT Professional having 10 years of experiance in Web desgning and development

Object files are sources compiled into binary machine language, but they do not have library files, so they are not executed.
Comments

The computer can understand only binary language, which is object code. In your code, let's say you have used some functions like print, loops like (for, while etc.), conditions like if, case etc.For ex: X =20 10 = Y print(X,Y)Compiler flags error for 10 = Y as it is syntax(grammar) error. You need to...
read more

The computer can understand only binary language, which is object code. In your code, let's say you have used some functions like print, loops like (for, while etc.), conditions like if, case etc.
For ex: X =20
10 = Y
print(X,Y)
Compiler flags error for 10 = Y as it is syntax(grammar) error. You need to rectify the error.
In the above code, you have used print.
But how do computers know what to do with print? It does not. These pre-written built-in functions are already written in a binary language and are stored in Libraries. That means you need not write code for these functions. All that you need to do is, use them. When your source code is converted into object code, the compiler will check for syntax, if fine, converts them to object code.
and then your object code is linked with Libraries (means semantics is established)
E.g., Ravana Killed Rama. This is syntactically right but semantically (meaning implied by the sentence is "Meaningless sentence").
Rama killed Ravana is syntactically and semantically CORRECT.
In the same way, when you use print in your code, the meaning or what to do will be implied during linking to libraries. Then only object code will be converted into complete Executable code.
The Executable code, without regard for device/OS, can execute anywhere.

read less
Comments

IT Project Manager for 20+ years

The computer can understand only binary language, which is object code. In your code, let's say you have used some functions like print, loops like (for, while etc.), conditions like if, case etc.For ex: X =20 10 = Y print(X,Y)Compiler flags error for 10 = Y as it is syntax(grammar) error. You need to...
read more

The computer can understand only binary language, which is object code. In your code, let's say you have used some functions like print, loops like (for, while etc.), conditions like if, case etc.
For ex: X =20
10 = Y
print(X,Y)
Compiler flags error for 10 = Y as it is syntax(grammar) error. You need to rectify the error.
In the above code, you have used print.
But how do computers know what to do with print? It does not. These pre-written built-in functions are already written in a binary language and are stored in Libraries. That means you need not write code for these functions. All that you need to do is, use them. When your source code is converted into object code, the compiler will check for syntax, if fine, converts them to object code.
and then your object code is linked with Libraries (means semantics is established)
E.g., Ravana Killed Rama. This is syntactically right but semantically (meaning implied by the sentence is "Meaningless sentence").
Rama killed Ravana is syntactically and semantically CORRECT.
In the same way, when you use print in your code, the meaning or what to do will be implied during linking to libraries. Then only object code will be converted into complete Executable code.
The Executable code, without regard for device/OS, can execute anywhere.

read less
Comments

Tutor taking Computer subjects Classes

Object Code is verified and syntactically correct code which is ready to be executed. However, the code has to be linked with the library functions used in the program for execution. Finally, all the modules are loaded after that object code is converted to the exe file, which gets executed to produce...
read more

Object Code is verified and syntactically correct code which is ready to be executed. However, the code has to be linked with the library functions used in the program for execution. Finally, all the modules are loaded after that object code is converted to the exe file, which gets executed to produce the output.

read less
Comments

Ethical Hacker and Computer Scientist

Object files are the output of a compiler; they are binary machine-readable bits of programs that are not capable of being run because no libraries have been used at this time. There are no logical connections that the system can make and the only function that exists is the one described in the source...
read more

Object files are the output of a compiler; they are binary machine-readable bits of programs that are not capable of being run because no libraries have been used at this time. There are no logical connections that the system can make and the only function that exists is the one described in the source file.

read less
Comments

Engineer - Computer Science, Expert

For program execution, static and dynamic libraries are required to be linked. Just the object of a source file is not enough. study COFF. It may help understanding a new concept.
Comments

IT Professional Trainer Coach (with 15+ yrs of experience for All boards from 6th std to Engineering

Object files are files that are converted by the compiler. These object files can be stored for future execution purposes on another machine or the same platform. However, there are no linkings done yet to these object files. After linking them from libraries, they are converted into executable exe files.Also,...
read more

Object files are files that are converted by the compiler. These object files can be stored for future execution purposes on another machine or the same platform. However, there are no linkings done yet to these object files. After linking them from libraries, they are converted into executable exe files.
Also, it links only those library files that are relevant to a particular platform.
Hence object codes are not executables.
Best luck..!

read less
Comments

M.sc (Comps) pursuing M.Tech

Object files are the output of a compiler; they are binary machine-readable bits of programs that are not capable of being run because no libraries have been used at this time. There are no logical connections that the system can make and the only function that exists is the one described in the source...
read more

Object files are the output of a compiler; they are binary machine-readable bits of programs that are not capable of being run because no libraries have been used at this time. There are no logical connections that the system can make and the only function that exists is the one described in the source file.
An executable has all dependencies and library files resolved and so can be executed directly by the CPU.

read less
Comments

Object files are not executed due to logical linking.
Comments

View 7 more Answers

Related Questions

Why is the C program giving the wrong output?
Hi Chandra, Please remember that the program will not give wrong output. The output might be wrong only in the case where there has been incorrect logic used or different output is expected. What is the...
Chandra
0 0
5
What is an rvalue?
Rvalue was added with the C++11 standard. An lvalue is an expression that refers to a memory location and allows us to take the address of that memory location via the & operator. An rvalue is an expression...
Mohd
What is a stream?
Stream means flow... ofstream This data type represents the output file stream and is used to create files and to write information to files. ifstream This data type represents the input file stream and is used to read information from files
Nilam
Is C programming and embedded C the one and the same?
in c language only u can learn c language concepts but in embeded c u can learn the in depth knowlege on c and embeded for machinelearning purpose i prefered to learn embeded c
Yogesh
0 0
5
What are security issues in the C language?
Even though the C language is widely used in different systems still it has many security flaws associated with it. This article focuses on discussing security vulnerabilities in the C language. Mainly...
Avinesh
0 0
7

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

C Language
To get help in C window (for keywords, functions) press Alt +F1.To delete a single line , use the shortcut key CTRL +Y.If you got error about the path when you execute a C pgm, check the Options menu =>Directories.
T

Thilagam S.

0 0
0

C PROGRAM FOR GENERATING SOUND
#include<stdio.h> #include<conio.h> #include<dos.h> void main() { sound(3000); // sound function have single parameter , this parameter we put integer value its generating...

V. Muthu Ganeshan

0 0
0

Functions In C Programming
A C-language program is nothing but collection of Function, these are the building blocks of a ‘C’ program. Generally, a function mans a task. “Function is a...

Difference Between C Language and C Program
C Language: C Language is structured, high level and machine independent language. C Program: C Program is the collection of functions that are supported by C library.
S

Shashwat Kumar

0 0
0

Program to swap the value of two variables without using third variable(simplest way)...
int main() { int a=10,b=20; printf("values of a before swap ="%d,a); printf("values of b before swap ="%d,b); a=a+b; b=a-b; a=a-b; printf("******************"); printf("values of a after swap...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more