Код: Выделить всё
#include <vcl.h>
#include <fstream.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
FILE * f;
char ch[128]="###################Каталог собачников###################",*c;
AnsiString st;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
f=fopen("c:\\catalog_bib.txt","wt");
fprintf(f,ch);
fclose(f);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn2Click(TObject *Sender)
{
f=fopen("c:\\catalog_bib.txt","a");
fprintf(f,"\n");
st=Edit1->Text+" "+"-"+" "+Edit2->Text;
c=st.c_str();
fprintf(f,c);
fclose(f);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Close();
}