slt a tous!
j'ai programmé cette fct sous visual c++ mais mnt je veux la programmer avec BC++.
mais le problème ke j'ai trouvé ds BC++ c'est k'il ne connait pas les include #include<vector> et using namespace std;
svp aidez moi pr changer cette std et pr ke je puisse la compiler avec BC++.
int comparer()
{
int i,j;
cout<<"comparaison"<<endl;
ofstream fichier_comp("comparaison2.txt");
ifstream fichier1("f1.txt",ios::in);
ifstream fichier2("f2.txt",ios::in);
std::vector< std::string > file2;
std::string tmp;
while ( !fichier2.eof() )
{
fichier2 >> tmp;
file2.push_back(tmp);
}
std::vector<std::string>::iterator it;
fichier1 >> tmp;
while (!fichier1.eof() )
{
it = file2.begin();
while ((it != file2.end()) && (tmp != *it))
it ++;
if ( it == file2.end()) fichier_comp << tmp <<" \t";
fichier1 >> tmp;
}
fichier_comp.close();
fichier1.close();
fichier2.close();
}
bon pr vous expliquer ce ke fait ce code ,par exemple:
fichier1:charara1 charara2 lolo
fichier2: charara charara1 simsim
ds le fichier_comp: charara2 lolo
merci pr votre aide!!!
@+