Skip to content

Instantly share code, notes, and snippets.

@afeinberg
Created June 5, 2010 05:23
Show Gist options
  • Select an option

  • Save afeinberg/426330 to your computer and use it in GitHub Desktop.

Select an option

Save afeinberg/426330 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
FILE *f;
char c;
if (f = fopen("/dev/null", "w+")) {
while (c = getchar()) {
if (!fputc(c, f))
break;
}
return fclose(f);
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment