Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- #include "Functions.cpp"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- AnsiString input_string;
- char *input_char = (char *)malloc(1000); // исправлено
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- //Memo1->Text=AnsiString(base_mem);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &Key)
- {
- if (Key==13) {
- i[0]=1; while (i[0]!=100) {i[i[0]]=0;i[0]++;} i[0]=0; // счетчики -> ноль, старт
- input_string=Edit1->Text;
- input_char = input_string.c_str(); // исправлено
- //start();
- ofstream base_file("base.txt", ios::app );
- while (!base_file.eof()){base_file.write((char*)&(input_char[i[7]]), 1);i[7]++;}
- base_file.close();/*закрываем файл*/i[7]=0;
- }
- }
- //---------------------------------------------------------------------------
- //input_char = Edit1->Text.c_str();
- //strncat(input_char, "123", /*strlen(input_char)*/3);
- //MessageBox(0, base_mem, "Message", MB_ICONINFORMATION);
- // Напишите следующий код: AnsiString a = "Hello World";char *b = a.c_str();
- // AnsiString(имя указателя)
Add Comment
Please, Sign In to add comment