GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Placement Papers  >  TCS

 Print  |  
Question:  what is the difference between typedef and #define



April 04, 2007 00:07:35 #1
 narendra   Member Since: Visitor    Total Comments: N/A 

RE: what is the difference between typedef and #define...
 
#DEFINE IS used to give a constant value to a variable
example if #DEFINE PI 3.14 is used then the value 3.14 is used where ever we use the variable PI.
TYPE DEF is the user defined name to an already existing keyword, ex.
We can use AMOUNT as a USER DEFINED name in place of FLOAT keyword.
     

 

Back To Question