Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Considering '#defines' are done in a textual pre-precessing by the C pre-processor, they don't know much at all about the C language. You can define out int, long, struct or anything.

I have seen many people redefine 'for' and 'while'. These people often argue that it is an improvement.

  cpp
  #define sizeof(x) (size)sizeof(x)
  sizeof(UU)
^D

  # 1 "<stdin>"
  # 1 "<built-in>"
  # 1 "<command-line>"
  # 31 "<command-line>"
  # 1 "/usr/include/stdc-predef.h" 1 3 4
  # 32 "<command-line>" 2
  # 1 "<stdin>"
  (size)sizeof(UU)


> I have seen many people redefine 'for' and 'while'.

    #define while if




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: