home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 May
/
Chip_2002-05_cd1.bin
/
chplus
/
cpp
/
3
/
stl.exe
/
std1.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1998-02-09
|
5KB
|
224 lines
//----------------------------------------------------------------------------
//Standard Template Library Examples
// Adapted from console demos.
//
//Borland C++Builder
//Copyright (c) 1987, 1998 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "std1.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
int ct;
TForm1 *Form1;
extern int amain_ex();
extern int advance_ex();
extern int adj_diff_ex();
extern int accum_ex();
extern int alg1_ex();
extern int alg2_ex();
extern int alg3_ex();
extern int alg4_ex();
extern int alg5_ex();
extern int alg6_ex();
extern int alg7_ex();
extern int auto_ptr();
extern int binders();
extern int bitset();
extern int complex1();
extern int complex2();
extern int copy_ex();
extern int count_ex();
extern int distance_ex();
extern int eqlrange_ex();
extern int equal_ex();
extern int fill_ex();
extern int find_ex();
extern int find_fo_ex();
extern int for_each_ex();
extern int funct_ob_ex();
extern int graph_ex();
extern int heap_opts_ex();
extern int ice_cream_ex();
extern int innerprod_ex();
extern int lex_comp_ex();
extern int lex_comp_ex();
extern int list_ex();
extern int merge_ex();
extern int pqueue_ex();
extern int rev_itr_ex();
extern int sieve_ex();
extern int stack_ex();
extern int telephone_ex();
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void build_all()
{
accum_ex();
advance_ex();
adj_diff_ex();
alg1_ex();
alg2_ex();
alg3_ex();
alg4_ex();
alg5_ex();
alg6_ex();
alg7_ex();
auto_ptr();
binders();
bitset();
complex1();
complex2();
copy_ex();
count_ex();
distance_ex();
eqlrange_ex();
equal_ex();
fill_ex();
find_ex();
find_fo_ex();
for_each_ex();
funct_ob_ex();
heap_opts_ex();
ice_cream_ex();
innerprod_ex();
lex_comp_ex();
list_ex();
merge_ex();
pqueue_ex();
rev_itr_ex();
sieve_ex();
stack_ex();
telephone_ex();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
for (int j = 0; j < 200; j++)
if (Memo1->Lines->Strings[j] != "")
Memo1->Lines->Strings[j] = " "; // make space in Memo
ct = 0;
switch (ComboBox1->ItemIndex)
{
case 0:
build_all();
break;
case 1:
accum_ex();
break;
case 2:
advance_ex();
break;
case 3:
adj_diff_ex();
break;
case 4:
alg1_ex();
break;
case 5:
alg2_ex();
break;
case 6:
alg3_ex();
break;
case 7:
alg4_ex();
break;
case 8:
alg5_ex();
break;
case 9:
alg6_ex();
break;
case 10:
alg7_ex();
break;
case 11:
auto_ptr();
break;
case 12:
binders();
break;
case 13:
bitset();
break;
case 14:
complex1();
break;
case 15:
complex2();
break;
case 16:
copy_ex();
break;
case 17:
count_ex();
break;
case 18:
distance_ex();
break;
case 19:
eqlrange_ex();
break;
case 20:
equal_ex();
break;
case 21:
fill_ex();
break;
case 22:
find_ex();
break;
case 23:
find_fo_ex();
break;
case 24:
for_each_ex();
break;
case 25:
funct_ob_ex();
break;
case 26:
heap_opts_ex();
break;
case 27:
ice_cream_ex();
break;
case 28:
innerprod_ex();
break;
case 29:
lex_comp_ex();
break;
case 30:
list_ex();
break;
case 31:
merge_ex();
break;
case 32:
pqueue_ex();
break;
case 33:
rev_itr_ex();
break;
case 34:
sieve_ex();
break;
case 35:
stack_ex();
break;
case 36:
telephone_ex();
break;
}
}
//---------------------------------------------------------------------------