Thread: how compilers work

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    1

    how compilers work

    hi guys am new to dis forum....guys can u pls help me to know after clicking compile button in c program wat happens.....wat compiler will do...i want to know step by step process wit example....how compilation done....and also i also want to learn about some important header files of c...explanation for d coding in d header files....and how it al starts from compilation to the output of d program.....guys could u help me...thanks in advance....http://cf1.g4estatic.com/smilies/more/pleased.gif

  2. #2
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    You should read this
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  3. #3
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    It all starts by learning to write proper English not SMS speak. How ironic that you want to learn about compilation, when you can't even be specific in a human language.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  4. #4
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Quote Originally Posted by Senthil Murugan View Post
    hi guys am new to dis forum....guys can u pls help me to know after clicking compile button in c program wat happens.....wat compiler will do...i want to know step by step process wit example....how compilation done....and also i also want to learn about some important header files of c...explanation for d coding in d header files....and how it al starts from compilation to the output of d program.....guys could u help me...thanks in advance....http://cf1.g4estatic.com/smilies/more/pleased.gif
    Holy ........, stop rambling.

    > after clicking compile button in c program wat happens
    Well, after the complicated process of googling "Compiler", I found this page which explains exactly that.

    > and also i also want to learn about some important header files of c
    Even if that wasn't a homework question, we're not here to tutor you. If you have a specific question, tell us.

    > explanation for d coding in d header files
    Does this look like a D forum? And furthermore, do you think that by typing, "explanation for ___.", you'll magically receive answers (to your homework)?

  5. #5
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by memcpy View Post
    Holy ........, stop rambling.

    > after clicking compile button in c program wat happens
    Well, after the complicated process of googling "Compiler", I found this page which explains exactly that.

    > and also i also want to learn about some important header files of c
    Even if that wasn't a homework question, we're not here to tutor you. If you have a specific question, tell us.

    > explanation for d coding in d header files
    Does this look like a D forum? And furthermore, do you think that by typing, "explanation for ___.", you'll magically receive answers (to your homework)?
    I think he meant d coding and in "da header" rather than D headers. He probably doesn't even know what D is.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  6. #6
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    Yeah, I have to reiterate here. You have a keyboard. Use it. Shortening "this" to "dis" doesn't save any significant time and really hurts our readability of the text.

    I'm more likely to help this guy:

    "hi guys am new to this forum....guys can you please help me to know after clicking compile button in c program what happens.....what compiler will do...i want to know step by step process with example....how compilation done....and also i also want to learn about some important header files of c...explanation for the coding in the header files....and how it all starts from compilation to the output of the program.....guys could you help me...thanks in advance...."

    But, seriously, I'm much more likely to help this guy:

    "Hi guys, I am new to this forum. Can you please help me to know, after clicking the compile button in a C program, what happens? What will the compiler do? I would like to know the step-by-step process with an example. And I would also like to learn about some important header files of C and some explanation for the coding in the header files. Could you help me, please? Thanks."

    But I would be INFINITELY more likely to help this guy:

    "Hi guys, I am new to this forum but I've done some Googling around and found XXXXX. Is this a good description of how a C program is compiled, or is it just abstract? Does it really happen like XXXXX? What about XXXX? How is that dealt with? I tried looking for information on that and haven't come up with anything useful except XXXXXX. Does anyone have any resources I can use to learn about this sort of thing? Thanks."

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. compilers
    By pablob in forum C Programming
    Replies: 3
    Last Post: 07-26-2011, 09:04 AM
  2. Compilers
    By lruc in forum Tech Board
    Replies: 21
    Last Post: 10-07-2008, 02:23 AM
  3. ? about compilers
    By newbie02 in forum C++ Programming
    Replies: 3
    Last Post: 08-01-2003, 01:08 PM
  4. C compilers
    By Rah in forum C Programming
    Replies: 10
    Last Post: 04-24-2003, 04:09 AM
  5. compilers
    By gamer in forum C++ Programming
    Replies: 3
    Last Post: 01-14-2003, 12:57 PM