为何如此多的warning?
写如下程序,不知为何如此多达175个警告,警告在最后面还请大侠们指示!
#include < iostream >
#include < vector >
#include < algorithm >
#include < map >
#include < set >
#include < fstream >
#include < iterator >
#include < string >
using namespace std;
int main()
{
ifstream ifile( "input.txt" );
if( !ifile )
{
cerr<< " !! unable to open the necessary files. \n";
return -1;
}
string tword;
string ia[ 6 ] = { "a", "an", "or", "the", "and", "but" };
map<string,int> words;
set < string > iset;
iset.insert( ia, ia+6 );
while( ifile>>tword )
{
if( iset.count( tword ) )
continue;
words[ tword ]++;
}
map < string, int >::iterator it = words.begin();
bool ischeck = true;
string cstring;
while( ischeck )
{
cout<< " Input the word you want to check: ";
cin>>cstring;
if( words.count( cstring ) )
cout<<"it exits and the count is "<<words[ cstring ];
else
cout<<" sorry ! it is not in! ";
cout<<endl;
cout<<" do you like another word? Y \ N";
char is;
cin>>is;
if( is == 'n' || is == 'N' )
ischeck = false;
}
return 0;
}
警告见另外一贴。