| simple-write.c - Skrivning af tegn fra en tekststreng på en tekstfil. | Lektion 10 - slide 9 : 28 Program 1 |
#include <stdio.h>
int main(void) {
FILE *output_file_pointer;
char *str = "0123456789abcdefghijklmnopqrstuvw";
int i;
output_file_pointer = fopen("first-file", "w");
while (*str != '\0'){
fputc(*str, output_file_pointer);
str++;
}
fclose(output_file_pointer);
return 0;
}