Author Topic: C compiler  (Read 3854 times)

0 Members and 1 Guest are viewing this topic.

Offline nitz_kool2010

  • Member
  • Full Member
  • *
  • Points: 20
  • Posts: 128
    • View Profile
C compiler
« on: February 05, 2011, 05:28:39 pm »
just studied from the book that using a compiler one doesn't need to waste too much time in executing the same program multiple times as it saves the source code in object code form and therefore for multiple execution of the same program one can utilize the object program.I want to know is that an object program which we save after writing a program & running it in the compiler or  is it something else.I am a beginner plz help asap. :adore1  :adore1  :adore1
You do not have permission to give points
point 0 Points

This topic did not receive points.

Offline T3rminator

  • Always believe in yourself...
  • Administrator
  • Techbits Elite Member
  • *
  • Points: 5950
  • Posts: 2621
  • Always believe in yourself...

    • MAIT
    • _
      EEE
    • View Profile
C compiler
« Reply #1 on: February 05, 2011, 06:07:58 pm »
When you execute a program after saving, an object file is generated which is saved along with the code(where you have saved the code...usually it is at C:/->TC->Bin).Then with the help of this file, you can run the .exe file with the same name present there for executing the program.There is no need to open TurboC then :angel:

Offline nitz_kool2010

  • Member
  • Full Member
  • *
  • Points: 20
  • Posts: 128
    • View Profile
C compiler
« Reply #2 on: February 05, 2011, 06:50:36 pm »
Quote from: T3rminator on February 05, 2011, 06:07:58 pm
When you execute a program after saving, an object file is generated which is saved along with the code(where you have saved the code...usually it is at C:/->TC->Bin).Then with the help of this file, you can run the .exe file with the same name present there for executing the program.There is no need to open TurboC then :angel:

I wrote a program in the compiler after getting the output i saved that progm.after searching a bit in the bin folder i found that there was a file which when opened showed me the output.along with that there was a notepad with the same name  showing the source progm.when i opened the compiler again i found the whole coding written as it is on the screen.you mean to say that the file which showed the output was my object program?plz reply  

Offline sagrma

  • Administrator
  • Techbits Elite Member
  • *
  • Points: 6229
  • Posts: 5208

    • MAIT
    • _
      ECE
    • View Profile
C compiler
« Reply #3 on: February 05, 2011, 07:03:53 pm »
if you will see it from very very basic(eg. assembly; dont worry i will come to c/c++)
it is like

1.editor: you need editor to write in your program

after you have done that you save it with extension(.c/.cpp) so that compiler can recognize it

2.now compiler take the source code and covert it into object code

3.the linker than come in and link the module

4.after this step physical memory is allocated and a exe file it produced which can be executed


now in c/c++ all these jobs are done by turbo c

i will update the 4 point as it need modification  

Offline SagarDabas

  • Live Curious!!!!!!
  • Member
  • Newbie
  • *
  • Points: 1
  • Posts: 45
  • Live Curious!!!!!!
    • View Profile
C compiler
« Reply #4 on: February 05, 2011, 10:29:22 pm »
The compiler convert the code into the machine language and store the result in object code.....


But the object code is not enough...there are two things still missing in it...the first is the code for the library functions and the second is the startup code....

Startup code : It acts as an interface between your program and the system since different systems(like DOS and Linux) handle programs differently from one another.

Basically object code is just the translated form of your program into machine language but still not executable...

The linker link these three elements 1.)Object code . 2.)Library functions . 3.)Startup Code and make a executable file.....
« Last Edit: February 05, 2011, 11:17:36 pm by SagarDabas »
Live Curious

Offline techmaniac

  • kar bhla to ho bhla
  • Alumni
  • Techbits Elite Member
  • *
  • Points: 335
  • Posts: 2845
  • kar bhla to ho bhla
    • _
      Not Specified
    • View Profile
C compiler
« Reply #5 on: February 06, 2011, 12:01:14 am »
Quote from: nitz_kool2010 on February 05, 2011, 05:28:39 pm
just studied from the book that using a compiler one doesn't need to waste too much time in executing the same program multiple times as it saves the source code in object code form and therefore for multiple execution of the same program one can utilize the object program.I want to know is that an object program which we save after writing a program & running it in the compiler or  is it something else.I am a beginner plz help asap. :adore1  :adore1  :adore1

 
its al simple to understand,
 
source code: source code is the code written in human readable language which human can easily understand.
 
Object code :  onject code is the code written in machine language which human cant understand.
 
Now come one how they interact?
 
so let say you are writting a first programme first time in a life on turbo C i.e. ADD two Numbers.
 
now when you press ctrl+F9 then your programme execute,i.e. your platform or machine read your programme successfully,NO Problem atall.
 
now when you see your directory it has 2 extra file,one object code and second exe.
 
OBJECT CODE STORE YOUR CODE IN MACHINE LANGUAGE.
and exe is created when linker join assemblies and machine code.(and for this a linker require which is handle by turbo c itself).
 
so when ever you have to execute your programme you only need to press exe file.
 
there is no relation b/w execution and object file.
 
 
HOPE YOU UNDERSTAND!!
and I LIKE THIS KIND OF QUERIES,PLEASE ASK DAILY.

Offline nitz_kool2010

  • Member
  • Full Member
  • *
  • Points: 20
  • Posts: 128
    • View Profile
C compiler
« Reply #6 on: February 06, 2011, 11:34:44 am »
THANX a ton for the replies.... :clap1  :clap1  :clap1
one last question plz...
are we required to save the program in turbo c after execution for the computer to generate object file or is it created automatically after execution?
sorry one more...
if i want to modify my source program ,what will be the procedure for that since there will be only two files available one exe & the other one obj.
hope u people wont mind answering my silly questions...
« Last Edit: February 06, 2011, 11:50:34 am by nitz_kool2010 »

Offline akash.pandey1992

  • Member
  • Newbie
  • *
  • Points: 2
  • Posts: 2
    • View Profile
C compiler
« Reply #7 on: February 22, 2012, 10:29:28 pm »
I am a second sem student,i want a c compiler,i have got a 64 bit,windows 7,laptop,i downloaded turbo c ,but was not able to install it as the i got was,that this version of the software is not compatible with the windows,can someone provide me with a solution ?

thanking you in anticipation.

Offline dext3r

  • Alumni
  • Techbits Elite Member
  • *
  • Points: 3825
  • Posts: 2634

    • USIT
    • _
      ECE
    • View Profile
C compiler
« Reply #8 on: February 22, 2012, 10:58:51 pm »
Quote from: akash.pandey1992 on February 22, 2012, 10:29:28 pm
I am a second sem student,i want a c compiler,i have got a 64 bit,windows 7,laptop,i downloaded turbo c ,but was not able to install it as the i got was,that this version of the software is not compatible with the windows,can someone provide me with a solution ?

thanking you in anticipation.


Run Turbo C in DOSBOX, it will work den..

Download here:
http://www.dosbox.com/download.php?main=1

Hope it Helps ! :)


READ THE FORUM RULES BEFORE POSTING


Wait For Replies | Post Only Once | Ask in Relevant Threads | Avoid Creating New Topics

Offline androgeek

  • Member
  • Newbie
  • *
  • Points: 71
  • Posts: 43
    • View Profile
C compiler
« Reply #9 on: February 22, 2012, 11:32:03 pm »
Quote from: akash.pandey1992 on February 22, 2012, 10:29:28 pm
I am a second sem student,i want a c compiler,i have got a 64 bit,windows 7,laptop,i downloaded turbo c ,but was not able to install it as the i got was,that this version of the software is not compatible with the windows,can someone provide me with a solution ?

thanking you in anticipation.


You can check here:-

Download here: Turbo C++ 64 bit


 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49