Fichier de l'aide svp

silverfr78021959 Messages postés 45 Date d'inscription mercredi 9 juin 2004 Statut Membre Dernière intervention 30 novembre 2005 - 30 nov. 2005 à 09:53
ekinox17 Messages postés 66 Date d'inscription jeudi 6 octobre 2005 Statut Membre Dernière intervention 18 janvier 2006 - 30 nov. 2005 à 10:50
Bonjour, voilà j'ai créé une fonction qui me permet de stocker différente valeur dasn un fichier, mais j'aimerais les stocker dans un fichier différents pour chque valeur je m'explique.
Voilà en faite la valeur diaq = diIt->first; vas etre différente et parfois identique et je voudrais mettre dans un fichier différent chaque valeur c'est a ire totue les valeurs dans un fichier différents et si une valeur se rzepete on la met dans l'un des fichier ou a valeur est deja existante.
Mais la franchement je vois pas comment faire. Mais attention avec la valeurs diaq = diIt->first; d'autre viennet se mettre dans les fichier cela explique les différentes boucle. Mais moi l'incrustation dans les fichier depend des la premiere boucle merci de pouvoir m'aider. car la totu est écrit dasn un seule fichier

<HR>



int fonc()
{
// Variables
int pos=0;
string pa, do, temck, paNb, di;
// creation of the files
ofstream files(conf.conf["filefonc"].c_str(), ios::out);
ofstream filee(conf.conf["fileer"].c_str(), ios::out);
//déclaration of the iterator
map<string,Di>::iterator diIt;
map<string,Blo>::iterator bloIt;
map<string,Par>::iterator parIt;
list<Ru>::iterator ruIt;
list<string>::iterator conIt;
bool conK;


// loops

for(diIt=fase.dia.begin();diIt!=fase.dia.end();diIt++)
{

// loop of research of the character - and modified by _
diaq = diIt->first;
while ((pos=diaq.find("-",0)) != string::npos )
diag.replace(pos, 1, "__");
cout << diaq << endl;
if(S.tab.count(diIt->first)>0)
if((conf.conf[DIST]=="")||(conf.conf[DIST].find(S.tab[diIt->first])!=conf.confi[DIST].npos))
{
for(bloIt=diIt->second.blos.begin();bloIt!=diIt->second.blos.end();bloIt++)
{
if(rues.rues.count(bloIt->second.tye)>0)
{
par = diaq + "_" + conf.confi["d"] + "_" + bloIt->first;


for(ruIt=rues.rules[bloIt->second.tye]->rie.begin();ruIt!=rues.rues[bloIt->second.tye]->rues.end();ruIt++)
{
conK = true;
//Test for existence consts
if(ruIt->consts != NULL)
{
for(conIt=ruIt->consts->begin();conIt!=ruIt->consts->end();conIt++)
{
if(bloIt->second.par.count(*conIt)<1)
{
conK = false;
}
}
}
if(conK)
{
if(sp.Fs.count(S.tab[diaIt->first])>0)
{

dollar = ruIt->epr;
// loop of research of the character $
while ((pos=dol.find("$",0)) != string::npos )
dol.replace(pos, 1, par);



temck = bloIt->first;
temck = tempck.erase(2, 3);

if(sp.Fs[S.tab[diIt->first]].count(bloIt->first)>0 && ruIt->ex == "")
{
files << "D_";
files << dol << endl;
}
else
{
cout << "rien" << endl;
}
}
else if (S.tab[diIt->first] != "")
{
filee << S.tab[diIt->first] << " iren"<< endl;
}
}
}
}

else if( bloIt->second.tye == "E")
{
for(parIt=bloIt->second.par.begin();parIt!=bloIt->second.par.end();parIt++)
{
if(sp.Fs.count(S.tab[diIt->first])>0)
{
if (sp.Fs[S.ta[diIt->first]].count(bloIt->first + "." + parIt->first)>0)
{

files << "D_";
files << "B";
files << "_" << "PARAM_1: ";
files << endl;
}
else filee << "jh: " << di << endl;
}
else if (S.tab[diIt->first] != "")
{
filee << S.tab[diIt->first] << " : "<< endl;
}
}
}
else filee << ": " << endl;
}
}
else filee << "ere" << endl;
}

files.close();
filee.close();
return 0;
}



<HR>


je precise que la fonction est opérationnelle !

1 réponse

ekinox17 Messages postés 66 Date d'inscription jeudi 6 octobre 2005 Statut Membre Dernière intervention 18 janvier 2006
30 nov. 2005 à 10:50
Fiou ....

il est illisible ton code t'es sur que tu etait obliger de mettre tout ça ?

en plus j'ai rien pigé a ton explication : ton problème est sans doute
compliqué mais prend un peu de temps pour essayer qu'on le comprenne ;)
0
Rejoignez-nous