私はコードブロックを使用して C++ プログラムを作成しましたが、最後の最後で、私たちが実験を行うために使用する学校のサーバーである empress を使用することにしましたが、それが機能しないことがわかりました! どういう意味ですか?私のプログラムは正しくありませんか?それともコンパイラの問題でしょうか?私は通常、コードブロックを使用してLinux ubuntuを使用してプログラミングを行います。Windowsを使用してプログラムをテストしましたが、動作しました。サーバー上で実行されないのはなぜですか?
問題の原因と思われるコードは次のとおりです。
bool dictionary::insertWordsIntoDict(string fileName)
{
ifstream inp;
string word;
vector<string> vec;
inp.open(fileName.data());
if(inp.good())
{
while(!inp.eof())
{
inp>>word;
vec.push_back(word);
}
string temp;
string temp2= "#.txt";
for(int i=0 ; i<vec.size() ; i++)
{
temp = vec[i];
temp2[0] = tolower(temp[0]);
cout<<temp<<endl;
AddWord(temp.data(), temp2);
}
}//end of if statement
else
{
cout<<":( File does not exist! "<<endl;
return failure;
}
}// end of function insert words