17
PaperBag
10d

Got bored and opened /usr/include/stdio.h to see if I can learn something from it.

But what I found... I now cannot unsee...

This whole time... it was all an illusion...
Life will never be the same again.

Comments
  • 3
    oh dear.......

    And C99 was meant to be an improved standard......
  • 4
    Well hey now ... at least you did learn something. Something that can't be unseen ... but something none the less.
  • 0
    so basically they are all the same? Just given different name to make them happy?
  • 6
    @gitpush Not quite. stdin, stdout and stderr are three different data structures, defined in an external source file (hence the "extern" keyword). The problem was that they are not macros.
    Macros instruct the compiler to replace every X in the code with Y before compiling.
    "#define LEN 40" means "replace LEN with 40", and "#define stdin stdin" means "replace stdin with stdin"... which does nothing.
    So now they technically are macros, just useless ones.
  • 2
    @PaperBag oh now I understand, I'm not a C/C++ dev so don't really know, thanks for clearing it up
  • 0
    C is shit, cpp is good. Understand why, now?
Your Job Suck?
Get a Better Job
Add Comment