작동하지 내가 내 동안 조건에 대해 거짓 부울 bValue =를 사용할 필요가 있다고 생각 :ifstream object.eof()
char cArray[ 100 ] = "";
ifstream object;
cout << "Enter full path name: ";
cin.getline(cArray, 100);
if (!object) return -1 // Path is not valid? This statement executes why?
ifstream object.open(cArray, 100);
// read the contents of a text file until we hit eof.
while (!object.eof())
{
// parse the file here
}
왜 내가 텍스트 파일의 전체 경로 이름을 입력 할 수 없습니다?
eof 때문일 수 있습니다. eof를 에뮬레이트 할 수있는 부울 문에 대한 구문은 무엇입니까?
은 내가 가질 수
while (!object == true)
{
// parase contents of file
}
합니다. 실제로 컴파일 한 것을 다시 입력 했습니까? 어쩌면 문제가있는 코드를 복사하여 붙여 넣어야합니다. –