2011-11-28 2 views
1

나는이 간단한 문제입니다 확신 해요,하지만 난 그것을 해결하는 데 문제가 있어요 :ifstream의 IStream을하고 >> 과부하

나는 컴파일러에서이 나타날 코드의

cdcheck.cpp|31|error: 'slectionsIn' was not declared in this scope 

잘못된 블록 :

주에서

: PlayListItem.cpp에서

...snip 
ifstream selectionsIn (argv[2]); 
PlayListItem item; 
int itemCount = 0; 
while (slectionsIn >> item) 
{ 
...snip 

:

std::istream& operator>> (std::istream& in, PlayListItem& pl){ 

필요한 경우 이러한 파일의 내용을 게시 할 수 있습니다. 선언에서 istream에서 ifstream으로 변경하면 올바르게 컴파일되지만, PlayListItem.cpp는 수정할 수 없다는 점에 유의해야합니다.

+8

맞춤법 검사 : 'selectionsIn' 또는'slectionsIn'? –

+1

SO - 맞춤법 검사 온라인 : s – pezcode

답변

2

비교

ifstreamselectionsIn(argv[2]);

while (slectionsIn>> item)

3

컴파일러 에러 메사에서 언급 된 식별자의 철자를 고정 시도 GE :

while (selectionsIn >> item) // not: slectionsIn 
관련 문제