甲蟲木工小站
2008年1月24日 星期四
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int intArray[20]={ 0,5,2,3,4,1,1,5,2,3,
5,4,2,1,5,2,3,4,1,2};
for(int i=0;i<20;i++)
{
mIntStack.push(intArray[i]);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
while(!mIntStack.empty())
{
OutString.sprintf("%d",mIntStack.top());
Memo1->Lines->Add(OutString);
mIntStack.pop();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
mFloatStack=mIntStack;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender)
{
float floatArray[20]={ 1.5,2.1,3.4,4.1,5.2,2.3,4.0,1.1,2.1,4.0,
2.1,3.2,4.1,5.5,4.1,4.5,5.7,0.9,1.5,2.3};
for(int i=0;i<20;i++)
{
mFloatStack.push(floatArray[i]);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button5Click(TObject *Sender)
{
while(!mFloatStack.empty())
{
OutString.sprintf("%f",mFloatStack.top());
Memo1->Lines->Add(OutString);
mIntStack.pop();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button6Click(TObject *Sender)
{
mIntStack=mFloatStack;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
}
//---------------------------------------------------------------------------
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
其他連結
鳥哥私房菜
xyssl
維基百科
Effective C++
kimo
kimo
C++
C++ 愛好者天堂
Boost
標籤
Linux
Template
windows
網誌存檔
►
2010
(4)
►
6月
(4)
▼
2008
(3)
▼
1月
(3)
Member Initialization List
Template
//----------------------------------------------...
►
2007
(2)
►
11月
(1)
►
7月
(1)
關於我自己
Lord_Fox
檢視我的完整簡介
沒有留言:
張貼留言