
Voila j'essaye de faire des fichiers strucurés.
le probleme etant que les int de la structures s'ecrive bien sur le fichier mais pas les ansistring.
ex :
struct fille{
char nom[80] ;
int score;};
void __fastcall TForm1::Button2Click(TObject *Sender)
{
struct fille filleenreg;
strcpy(filleenreg.nom,Form1->Edit1->Text.c_str());
filleenreg.score = StrToInt(Form1->Edit2->Text);
FileWrite(handle,&filleenreg,sizeof(filleenreg));
___Ca sa marche________
-----------------------------------------------------------------
struct fille{
ansistring nom ;
int score;};
void __fastcall TForm1::Button2Click(TObject *Sender)
{
struct fille filleenreg;
filleenreg.nom = Form1->Edit1->Text ;
filleenreg.score = StrToInt(Form1->Edit2->Text);
FileWrite(handle,&filleenreg,sizeof(filleenreg));
}
__ et la ca ne marche pas
_________________________________________________________
________________________________________________________
je ne voit pas pourquoi avec un anssistring la structure est mal ecrite ds le fichier. tandis qu'avec char[80] ca marche
merci a qui serait me repondre
bon prog
ps : dev en c++builder