Randomly Organized Things

A collection of partially-coherent thoughts.

Fun with #define in C — July 25, 2015

Fun with #define in C

I was messing around the other day with C/C++ and began to realize what all you could do with #define. I knew it was just a text replacement, so it could probably be anything. So I began to wonder, what can’t it do? I did some tests, and here are a few things that worked:

Now, I realize this isn’t exactly the ideal way to do things, but it seems that with a WHOLE lot of #define, you could make your whole program just random words!

Advertisements