You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
811 B

/**
* :author: Dan Buch (daniel.buch@gmail.com)
*/
#include <stdio.h>
#define f(a, b) a##b
#define g(a) #a
#define h(a) g(a)
#define border(c) \
for (int i = 0; i < 60; i++) { \
printf(c); \
} \
printf("\n");
int main()
{
printf("%s\n", h(f(1, 2)));
printf("%s\n", g(f(1, 2)));
printf("%s\n", g(printf("dogs rule cats drool\n")));
char * hambones = "Cats! " g(ham);
char * bonesham = "Meats! " g(bones);
char * tmp;
border("-");
printf("bonesham = %s\n", bonesham);
printf("hambones = %s\n", hambones);
border("-");
tmp = f(ham, bones);
f(ham, bones) = f(bones, ham);
f(bones, ham) = tmp;
printf("bonesham = %s\n", bonesham);
printf("hambones = %s\n", hambones);
return 0;
}
/* vim:filetype=c:fileencoding=utf-8
*/