Skip to content

Instantly share code, notes, and snippets.

@kmcallister
Created April 5, 2013 01:22
Show Gist options
  • Select an option

  • Save kmcallister/5315876 to your computer and use it in GitHub Desktop.

Select an option

Save kmcallister/5315876 to your computer and use it in GitHub Desktop.
open a buncha files
#include <stdio.h>
int main() {
FILE *f[512];
char name[512];
int n;
for (n=0; n<512; n++) {
sprintf(name, "file%d", n);
f[n] = fopen(name, "w");
fprintf(f[n], "Hello, %d\n", n);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment