fopen()
, fprintf()
, 和 fclose()
。,,``c,#include,,int main() {, FILE *file = fopen("example.txt", "w");, if (file == NULL) {, perror("Failed to open file");, return 1;, }, fprintf(file, "Hello, World!\n");, fclose(file);, return 0;,},
``