我敢肯定,这是一个简单的问题,但我有麻烦解决它:ifstream的istream和超负荷>>
我收到这个来自编译:
cdcheck.cpp|31|error: 'slectionsIn' was not declared in this scope
问题的代码块:
主:
...snip
ifstream selectionsIn (argv[2]);
PlayListItem item;
int itemCount = 0;
while (slectionsIn >> item)
{
...snip
在PlayListItem.cpp
:
std::istream& operator>> (std::istream& in, PlayListItem& pl){
如果需要,我可以发布这些文件的内容。应该指出的是,如果我在声明中从istream更改为ifstream,则编译正确,但我无法修改PlayListItem.cpp,只能修改main。
检查您的拼写:'selectionsIn'或'slectionsIn'? –
SO - 在线拼写检查:s – pezcode