1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stdio.h> int main (int argc, char * argv[]) { const char *out = "SUCCESS!"; if (argc != 2) { printf ("%s\n", out); } else { int ret; FILE *f = fopen (argv[1], "w"); ret = fwrite (out, sizeof (out), 1, f); if (ret != 1) return -1; } return 0; }