Курсовая работа: Динамические структуры данных
strcpy (str, Edit1->Text. c_str ());
char* str2 = new char [Edit2->Text. Length () + 1] ;
strncpy (str2, Edit2->Text. c_str (),
6);
char* str3 = Edit3->Text. c_str ();
char* ptr = strtok (str3, "; ");
char** p = new char* [255] ;
int n = 0;
while (ptr)
{
p [n] = new char [6] ;
strncpy (p [n], ptr,
6);
ptr = strtok (NULL, "; ");
n++;
}
stack->Add (str, str2, n, p);
}
// ---------------------------------------------------------------------------
void __fastcall TForm1:: Button4Click (TObject *Sender)
{
Memo1->Lines->Clear ();
if (! stack) return;
stack->Print (Memo1);
}
// ---------------------------------------------------------------------------
void __fastcall TForm1:: Button2Click (TObject *Sender)
{
if (! stack) return;