Skip to content

Instantly share code, notes, and snippets.

@clauswitt
Created November 24, 2015 07:50
Show Gist options
  • Save clauswitt/7acb9e8fe8ca03198a90 to your computer and use it in GitHub Desktop.
Save clauswitt/7acb9e8fe8ca03198a90 to your computer and use it in GitHub Desktop.
#include<stdlib.h>
#include<stdio.h>
main() {
FILE *f = fopen("file.txt", "w");
if (f == NULL)
{
printf("Error opening file!\n");
exit(1);
}
const char *text = "This data will be written to disk";
fprintf(f, "%s\n", text);
fclose(f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment