brintos

brintos / llvm-project-archived public Read only

0
0
Text · 393 B · 2ebaa14 Raw
22 lines · c
1#include <stdio.h>2#include <string.h>3#include <stdlib.h>4 5/* This program writes its arguments (separated by '\0') to stdout. */6int7main(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