   Totally awesome #defines
  Yea, so this is one of those extremely fun threads where you post a cool/funny #define! Actually I have no idea if it's fun or not (mayhaps not).. but the reason I posted this is because yesterday I found out that you could do:#define ½ 0.5fand use it like:float value = ½;Sooo any other cool defines?[Edited by - BauerGL on May 25, 2006 4:38:40 AM]
  #define is not cool or fun. :PRemember children:Guns don't kill people, #define kills people.   ;  Remember:Every time you use #define, God kills a kitten.THINK OF THE KITTENS!;Quote:Original post by curtmax_0Remember:Every time you use #define, God kills a kitten.THINK OF THE KITTENS!every time you propogate a tired internet meme, I mail dog shit to your house.   ;Quote:Original post by BauerGL#define ½ 0.5fI don't like #define:s, but that one is too cute not to be liked [grin]   ;  I've seen this used:#define assert(x) if(!(x)){*(int*)0 = 0;}Not sure if it counts as "Totally awesome" though [smile]   ;  Courtesy of The Daily WTF.../* * BETTER_C.H    * Language refinements for C.  */#ifndef BETTER_C_H#define BETTER_C_H/* logical/comparison operators */#define NE  !=#define EQ  ==#define GT  >#define LT  <#define GE  >=#define LE  <=#define AND &&#define OR  ||#define NOT !/* bitwise operators */#define bNOT ~#define bAND &#define bOR  |#define bXOR ^/* arithmetic operators */#define MOD   %/* control constructs */#define repeat    do#define until(p)  while(NOT (p))#define forever   while(1)#define untilbreak  forever#define untilreturn forever#define unless(p) if(NOT (p))#define ifnot(p)  if(NOT (p))#define do_nothing#define then...#endif;Quote:Original post by Evil SteveI've seen this used:#define assert(x) if(!(x)){*(int*)0 = 0;}Not sure if it counts as "Totally awesome" though [smile]Doesn't look awesome to me.  If you #define that, then you can end up with:if (a)  assert(foo)else  bar();And then you're in a whole world of pain.John B   ;Quote:Original post by RavuyaCourtesy of The Daily WTF...*** Source Snippet Removed ***They forgot the FileNotFoundian boolean defines.   ;Quote:Original post by JohnBSmallQuote:Original post by Evil SteveI've seen this used:#define assert(x) if(!(x)){*(int*)0 = 0;}Not sure if it counts as "Totally awesome" though [smile]Doesn't look awesome to me.  If you #define that, then you can end up with:*** Source Snippet Removed ***And then you're in a whole world of pain.John BHuh? You're only in a world of pain if foo is false, which is sort of the point of assert.   