ouramazingprogram.c
· 266 B · C
原始文件
#include <stdio.h>
#include <string.h>
char myData[100] = "That's my super important data!\n";
int main(void) {
printf("That's my amazing program!\n");
FILE *f = fopen("myotherfile.txt", "w");
fwrite(myData, strlen(myData), 1, f);
fclose(f);
return 0;
}
| 1 | #include <stdio.h> |
| 2 | #include <string.h> |
| 3 | |
| 4 | char myData[100] = "That's my super important data!\n"; |
| 5 | |
| 6 | int main(void) { |
| 7 | printf("That's my amazing program!\n"); |
| 8 | FILE *f = fopen("myotherfile.txt", "w"); |
| 9 | fwrite(myData, strlen(myData), 1, f); |
| 10 | fclose(f); |
| 11 | return 0; |
| 12 | } |
| 13 |