[求助] 帮忙看下这个错误什么意思?
- 我们第一次的作业:我写的代码是这样的:
作业是要求计算文件中给定的单词的个数
//: C02:file.txt
// count the speical word's number in the file
#include<string>
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
int number=0;
ifstream in ("file.txt");
string word,test;
cout<<"Please enter the word you want to quest:";
cin>>test;
while(getline(in,word," "))
{
if(word==test)
{
number++;
}
}
cout<<"The number of "<<test<<" is:"<<number<<endl;
}///:~
错误信息是这样的 :
--------------------Configuration: 111 - Debug--------------------
Compiling source file(s)...
Find.cpp
D:\课件\c++\test\Find.cpp: In function `int main()':
D:\课件\c++\test\Find.cpp:15: error: no matching function for call to `getline(
std::ifstream&, std::string&, const char[2])'
D:\课件\c++\test\Find.cpp:24:7: warning: no newline at end of file
111.exe - 1 error(s), 1 warning(s)
不知道是什么意思
大家帮忙看下
谢谢~~