獲取你自己的
網站
×
更改方向
更改主題,深色/淺色
前往 Spaces
#include <stdio.h> int main() { FILE *fptr; // Open a file in writing mode fptr = fopen("filename.txt", "w"); // Write some text to the file fprintf(fptr, "Some text"); // Close the file fclose(fptr); return 0; }
寫入檔案示例
這只是一個示例,展示了您開啟剛才寫入的檔案時會是什麼樣子