[AIDE] modification d'un fichier texte
Bonsoir,
j'ai un souci avec un mode écriture qui va modifier un fichier texte qui est de la forme : Nom;Qantite_Actuelle;Nb_Dose;Quantite_Max
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
cafe;1000000;1;1000000
the_vert;1000000;1;1000000
the_noir;1000000;1;1000000
the_citron;1000000;1;1000000
cacao;1000000;1;1000000
sucre;1000000;1;1000000
lait;1000000;1;1000000
potage_tomate;1000000;1;1000000
potage_celeri;1000000;1;1000000
potage_poulet;1000000;1;1000000
eau;1000000;1;1000000
batonnet;10000;1;10000
gobelet;10000;1;10000
sel;1000000;1;1000000 |
et voila ma fonction :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
void Ingredient::Consommer(int Nb_Dose)
{
char* Nom=NULL;
string Nom_Bis;
Nom_Bis=this->Get_Nom();
strcpy(Nom,Nom_Bis.c_str());
if(Nom!="eau") {
//-> écrire dans le fichier texte : Ingredient.txt et effectuer cette operation : Quantite_Actuelle = Quantite_Actuelle - Nb_Dose*Qte_Dose;???
}
} |
merci du coup de pouce.