CPP Hacks.
Jun. 25th, 2006 03:03 amFor ages I've belived that one couldn't paste a "\" in front of a "n" in C and have it produce a newline (\n). Well, you can. This works:
#include <stdio.h>
#define slash() \ //slash
#define strize(x) #x
#define strevl(x) strize(x)
#define slashit(x) strevl(slash()x)
int main(void)
{
printf("[%s]\n", slashit(n));
}
produces the output:[ ]As one might hope.
no subject
Date: 2006-06-25 07:12 am (UTC)no subject
Date: 2006-06-25 07:49 am (UTC)no subject
Date: 2006-06-25 05:45 pm (UTC)