#defines are preprocessor and get expanded at compile time.

Thanks,
Tyler Littlefield
Web: tysdomain.com
email: [email protected]
My programs don't have bugs, they're called randomly added features.

  ----- Original Message ----- 
  From: Kiran Divakaran 
  To: [email protected] 
  Sent: Wednesday, April 08, 2009 7:08 AM
  Subject: [c-prog] #define expansion runtime or compile time ?


  Hi All,

  I have a query with #defines in C.

  There is a -E compiler option which would expand the #define at compile time 
and create an intermediate file and create the object file for the same.

  But normally do #defines get expanded at compile time or at run time.

  My feeling it gets expanded at run time and not in the object code.

  Also inline functions inline the code which means these functions will have 
the code embedded in the object code.

  This is not the case for #defines which get expanded at runtime .

  Please clarify .

  Thanks,
  Kiran

  **************** CAUTION - Disclaimer *****************
  This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
  for the use of the addressee(s). If you are not the intended recipient, 
please 
  notify the sender by e-mail and delete the original message. Further, you are 
not 
  to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
  any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
  every reasonable precaution to minimize this risk, but is not liable for any 
damage 
  you may sustain as a result of any virus in this e-mail. You should carry out 
your 
  own virus checks before opening the e-mail or attachment. Infosys reserves 
the 
  right to monitor and review the content of all messages sent to or from this 
e-mail 
  address. Messages sent to or from this e-mail address may be stored on the 
  Infosys e-mail system.
  ***INFOSYS******** End of Disclaimer ********INFOSYS***

  [Non-text portions of this message have been removed]



  

[Non-text portions of this message have been removed]

Reply via email to