Skip to content

Instantly share code, notes, and snippets.

@eatnumber1
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eatnumber1/8d0b265276adc24e4c97 to your computer and use it in GitHub Desktop.
Save eatnumber1/8d0b265276adc24e4c97 to your computer and use it in GitHub Desktop.
The result of a challenge to write in C code that will do the following when run in Python: "good " * 2. I think I got a little carried away.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
for (char *s = "good ", l = strlen(s), z = 2 * l, d[z], *p = d; p == d + z ? *--p = 0, !puts(d) : 1; p = memcpy(p, s, l) + l);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment