[問題] fopen找不到 路徑已經檢查過
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++ 2010
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <stdlib.h>
問題(Question):
檔案指標cfPtr為空
路徑也試過把input.txt放在C:\,給路徑"C:\input.txt",結果還是一樣。
餵入的資料(Input):
無
預期的正確結果(Expected Output):
會讀到檔案
錯誤結果(Wrong Output):
檔案指標為空
程式碼(Code):(請善用置底文網頁, 記得排版)
if( (cfPtr = fopen("input.txt","r")) == NULL)
cout << "找不到檔案";
else
{
while(!feof(cfPtr))
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.122.197.50
→
11/29 17:16, , 1F
11/29 17:16, 1F
→
11/29 17:21, , 2F
11/29 17:21, 2F
→
11/29 17:22, , 3F
11/29 17:22, 3F
→
11/29 18:27, , 4F
11/29 18:27, 4F
推
11/29 22:01, , 5F
11/29 22:01, 5F
推
11/29 22:02, , 6F
11/29 22:02, 6F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章
14
43