引用 | 編輯
阿庚
2007-02-05 09:52 |
樓主
▼ |
||
x0
我想要寫一個新增空白TXT檔的程式讓使用者決定要產生幾個空白TXT檔 可是寫不出來不知道錯在那邊??? #include <stdio.h> #include <string.h .. 訪客只能看到部份內容,免費 加入會員 x0
|
引用 | 編輯
fredxxx123
2007-02-05 21:06 |
1樓
▲ ▼ |
痾…
雖然不知道你用什麼編譯的… 不過學習看錯誤訊息是很重要低@@ 你只錯在系統找不到system(...)這個識別項而已 複製程式 #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { FILE *fp; char buf[32]; int n,i; printf("請輸入要產生的檔案數目: "); scanf("%d",&n); for(i=0;i<n;i++) { sprintf(buf,"test%d.txt",i); fp=fopen(buf,"w"); fclose(fp); } system ("pause"); return 0 ; } 另外…下次貼code記得用語法包起來,這樣別人比較方便看 x0 |