1 #include <stdio.h>
2 #include <string.h>
3 #include <stdlib.h>
4 
5 /* This program writes its arguments (separated by '\0') to stdout. */
6 int
main(int argc,char const * argv[])7 main(int argc, char const *argv[])
8 {
9     int i;
10 
11     FILE *output = fopen (argv[1], "w");
12     if (output == NULL)
13         exit (1);
14 
15     for (i = 2; i < argc; ++i)
16         fwrite(argv[i], strlen(argv[i])+1, 1, output);
17 
18     fclose (output);
19 
20     return 0;
21 }
22