Vamsi Pavan’s Place

When curiousity outbursts …..

Redefining inbuilt data types

October 6th, 2006 · No Comments · C/C++

#include

typedef int INTEGER /* will work */
But
#define INTEGER int /* will also work*/

INTEGER SomeFunction()
{
…… code
return 0;
}
This will work
But Rule of thumb is
#defines are used for textual replacement whereas typedefs are used for introducing new names.

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

Tags:

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment