• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            to the world

            very mystery and interesting

            C++博客 首頁 新隨筆 聯系 聚合 管理
              11 Posts :: 0 Stories :: 5 Comments :: 0 Trackbacks

            2006年4月9日 #

            #include? < iostream.h >
            void ?main()
            {
            ??union
            ??
            {
            ?????
            int ?ig[ 3 ];
            ??????
            char ?s[ 12 ];
            ??}
            t;
            ??t.ig[
            0 ] = ox20494542;
            ??t.ig[
            1 ] = 0x474e494a ;
            ??t.ig[
            2 ] = 0x00000a21 ;
            }
            posted @ 2006-04-09 20:00 hacken 閱讀(119) | 評論 (0)編輯 收藏

            2006年2月28日 #

            最近是很郁悶了,好長時間做這個了
            感覺真是不知所措.
            希望快點做C++

            posted @ 2006-02-28 10:09 hacken 閱讀(198) | 評論 (0)編輯 收藏

            2006年1月24日 #

             

            int (*hacken)(int a,double b);
            是一個指向函數的指針,可以給它賦值如下:
            int (*hacken)();
            hacken
            =sin;
            其中sin是一個函數名。
            posted @ 2006-01-24 16:24 hacken 閱讀(220) | 評論 (0)編輯 收藏

            2006年1月21日 #

            #include <iostream.h>
            void main()
            {
              
            char*p1,a[16],b[16];
              p1
            ="i am a teacher.";
              
            for(int i(0);i<15;i++;)
                 a[i]
            =*p1+++1;
              a[i]
            ='\0';
              cout
            <<a<<endl;
              
            for(i=0;i<15;i++)
                b[i]
            =*(a+i)-1;
              b[i]
            ='\0';
              cout
            <<b<<endl;
            }

              
            6:26:54
            2005年1月14日
            怎么樣理解這個程序,有關其中的運算怎么做?
            posted @ 2006-01-21 17:00 hacken 閱讀(208) | 評論 (0)編輯 收藏

            2006年1月20日 #

            #include <iostream.h>
            void main()
            {
              
            char s1[]="abcd",s2[5];
              
            for(int i(0);i<5;i++)
                  s2[i]
            ='e'+1;
              cout
            <<s1<<endl;
              
            for(i=0;i<5;i++)
               cout
            <<*(s2+i);
              cout
            <<endl;
            }
                   
            他的結果是:abcd
                                    efghi
            怎么出來efghi的,我知道應該是d字符加1就是e ,但有點不懂,希望大家幫助我。
            謝謝。
            17:17:01
            2006年1月20日
            posted @ 2006-01-20 17:17 hacken 閱讀(347) | 評論 (2)編輯 收藏

            char *p1="one",*p2="two";
            strcmp(p1,p2)
            >0
            怎么樣對他們進行比較?希望得到大家的幫助。17:07:20,2006年1月20日
            posted @ 2006-01-20 17:08 hacken 閱讀(373) | 評論 (3)編輯 收藏

             

            #include <iostream.h>
            int strlen1(char a[])
            void main()
            {
              
            char s[]="abcdefg";
              
            char*p;
              
            int n=strlen1();
              
            for(p=s+n-1;p+1!=s;p--)
                 cout
            <<*p;
              cout
            <<endl;
            }

            int strlen1(char a[])
            {
              
            char *p=a;
              
            int i=0;
              
            while(a[i++]!='10')
                  p
            ++;
              
            return p-a;
            }
               在這個程序中,p=s+n-1該怎么理解?希望各位高手可以幫我理解,謝謝。
            posted @ 2006-01-20 17:04 hacken 閱讀(211) | 評論 (0)編輯 收藏

            2006年1月17日 #

             

            //---------------------------------------------------------------------------

            #ifndef UnitTetrisH
            #define UnitTetrisH
            //---------------------------------------------------------------------------
            #ifndef STRICT
            #  define STRICT
            #endif
            //---------------------------------------------------------------------------
            #include <Classes.hpp>
            #include 
            <Controls.hpp>
            #include 
            <StdCtrls.hpp>
            #include 
            <Forms.hpp>
            #include 
            "TetrisData.h"
            #include 
            <ExtCtrls.hpp>
            #include 
            <ActnList.hpp>
            #include 
            <Menus.hpp>
            #include 
            <AppEvnts.hpp>
            #include 
            "VictorDDraw8.h"
            //---------------------------------------------------------------------------
            class TFormTetris : public TForm
            {
            __published:    
            // IDE-managed Components
                TMainMenu *MainMenu1;
                TActionList 
            *ActionList1;
                TAction 
            *AnNew;
                TAction 
            *AnPause;
                TAction 
            *AnHScore;
                TAction 
            *AnExit;
                TMenuItem 
            *MmFile;
                TMenuItem 
            *New1;
                TMenuItem 
            *Pause1;
                TMenuItem 
            *HighScore1;
                TMenuItem 
            *Exit1;
                TMenuItem 
            *N1;
                TApplicationEvents 
            *ApplicationEvents1;
                TMenuItem 
            *H1;
                TAction 
            *AnHelp;
                TAction 
            *AnAbout;
                TMenuItem 
            *AnHelp1;
                TMenuItem 
            *AnAbout1;
                TAction 
            *AnSingle;
                TMenuItem 
            *S1;
                TMenuItem 
            *Speedset;
                TMenuItem 
            *N2;
                TAction 
            *AnSpeed;
                TVictorDDraw8 
            *VictorDDraw81;
                
            void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
                TShiftState Shift);
                
            void __fastcall AnNewExecute(TObject *Sender);
                
            void __fastcall AnPauseExecute(TObject *Sender);
                
            void __fastcall AnHScoreExecute(TObject *Sender);
                
            void __fastcall AnExitExecute(TObject *Sender);
                
            void __fastcall ApplicationEvents1Deactivate(TObject *Sender);
                
            void __fastcall LabelHomeClick(TObject *Sender);
                
            void __fastcall AnHelpExecute(TObject *Sender);
                
            void __fastcall AnAboutExecute(TObject *Sender);
                
            void __fastcall AnSingleExecute(TObject *Sender);
                
            void __fastcall FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
                
            void __fastcall AnSpeedExecute(TObject *Sender);
                
            void __fastcall ApplicationEvents1Idle(TObject *Sender, bool &Done);
                
            void __fastcall VictorDDraw81DispFrame(TCustomDDraw8 *Sender);
                
            void __fastcall VictorDDraw81RestoreFrame(TCustomDDraw8 *Sender);
                
            void __fastcall ApplicationEvents1Restore(TObject *Sender);
                
            void __fastcall ApplicationEvents1Activate(TObject *Sender);
            public:
                
            static const NumScores = 5;
                #pragma pack(push,
            1)
                typedef 
            struct
                 
            {
                   
            int Score;
                   
            char Name[32];
                 }
             TScoreItem;
                typedef union
                 
            {
                   
            struct
                    
            {
                      TScoreItem Scores[NumScores];
                      
            int Speed;
                    }
            ;
                   
            char Buffer[512];
                 }
             TTetrisParams;
                #pragma pack(pop)    
            private:    // User declarations
                __property bool Paused = { read = _bPaused, write = SetPause };

                
            static const BlockSize=20, BlockTop=10, BlockLL=10, BlockRL=298, BlockIL=206;
                
            bool _bPaused, _bSingle, _bGameOverL, _bGameOverR;
                TBaseTetris TetrisLeft, TetrisRight;
                TTetrisParams TetrisParams;
                
            //Graphics::TBitmap *TtBmp, *PsBmp, *OvBmp, *SgBmp, *BkBmp, *KkBmp, *MaskBmp;
                TDDrawSurface *TtSur, *PsSur, *OvSur, *SgSur, *BkSur;
                
            int iSurfaceWidth, iSurfaceHeight;
                
            bool bDisplayEnabled;

                
            int iFrames,iFrmCnt;
                
            char Str_L_Lines[64], Str_L_Score[64], Str_R_Lines[64], Str_R_Score[64], Str_Speed[64], Str_HighScore[64], Str_Fps[64];

                
            int LnLeft, LnRight, _iKeyDelay;
                
            int _iLeftDown, _iRightDown;
                
            int _iLeftLeft, _iLeftRight;
                
            int _iRightLeft, _iRightRight;

                unsigned 
            int nSysTimeInterval;
                
            int nTimerMainInterval, nTimerDownInterval;
                
            int iTimerMainC0, iTimerMainC1, iTimerDownC0, iTimerDownC1;
                
            void __fastcall EvTimerMainTimer(void);
                
            void __fastcall EvTimerDownTimer(void);

                
            void __fastcall InitSurfaces(void);
                
            void __fastcall LoadSurfaces(void);

                
            int  __fastcall GetInitSpeed(void);
                
            void __fastcall SetInitSpeed(int iSpd);
                
            int  __fastcall GetInitBackground(void); //
                void __fastcall SetInitBackground(int iBkg); //
                void __fastcall SetPause(bool);
                
            void __fastcall CheckGameStatus(void);
                
            void __fastcall RefreshDisplay(void);
                
            bool __fastcall TestKeyDown(int &iKey);
                
            void __fastcall DrawTetris(TDDrawDisplay *lpDisplay, TBaseTetris *lpTetris, int x0, int y0, bool bPlaySingle);
                
            void __fastcall DrawIncoming(TDDrawDisplay *lpDisplay, TBaseTetris *lpTetris, int x0, int y0);

                
            void LoadParams(void);
                
            void SaveParams(void);
                
            void GetPlayerName(char *lpName);
                
            void ShowHighScores(void);

            public:        // User declarations
                __fastcall TFormTetris(TComponent* Owner);
                __fastcall 
            ~TFormTetris();
                __property 
            int InitSpeed = { read = GetInitSpeed, write = SetInitSpeed };
                __property 
            int InitBackground = { read = GetInitBackground, write = SetInitBackground };//
            protected:
                
            void __fastcall WndProc(Messages::TMessage &Message);
            }
            ;
            //---------------------------------------------------------------------------
            extern PACKAGE TFormTetris *FormTetris;
            //---------------------------------------------------------------------------
            #endif
            posted @ 2006-01-17 18:10 hacken 閱讀(380) | 評論 (0)編輯 收藏

            //---------------------------------------------------------------------------

            #ifndef UnitTetrisH
            #define UnitTetrisH
            //---------------------------------------------------------------------------
            #include <Classes.hpp>
            #include 
            <Controls.hpp>
            #include 
            <StdCtrls.hpp>
            #include 
            <Forms.hpp>
            #include 
            "TetrisData.h"
            #include 
            <ExtCtrls.hpp>
            #include 
            <ActnList.hpp>
            #include 
            <Menus.hpp>
            #include 
            <AppEvnts.hpp>
            //---------------------------------------------------------------------------
            class TFormTetris : public TForm
            {
            __published:    
            // IDE-managed Components
                TPaintBox *PaintBox1;
                TMainMenu 
            *MainMenu1;
                TActionList 
            *ActionList1;
                TAction 
            *AnNew;
                TAction 
            *AnPause;
                TAction 
            *AnHScore;
                TAction 
            *AnExit;
                TPaintBox 
            *PaintBox2;
                TTimer 
            *Timer1;
                TMenuItem 
            *MmFile;
                TMenuItem 
            *New1;
                TMenuItem 
            *Pause1;
                TMenuItem 
            *HighScore1;
                TMenuItem 
            *Exit1;
                TMenuItem 
            *N1;
                TLabel 
            *LabelLines;
                TLabel 
            *LabelScore;
                TScrollBox 
            *ScrollBox1;
                TApplicationEvents 
            *ApplicationEvents1;
                TLabel 
            *LabelHome;
                TLabel 
            *Label2;
                TLabel 
            *Label3;
                TLabel 
            *Label4;
                TLabel 
            *LabelHighScore;
                TMenuItem 
            *H1;
                TAction 
            *AnHelp;
                TAction 
            *AnAbout;
                TMenuItem 
            *AnHelp1;
                TMenuItem 
            *AnAbout1;
                TLabel 
            *Label1;
                
            void __fastcall PaintBox1Paint(TObject *Sender);
                
            void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
                      TShiftState Shift);
                
            void __fastcall AnNewExecute(TObject *Sender);
                
            void __fastcall AnPauseExecute(TObject *Sender);
                
            void __fastcall AnHScoreExecute(TObject *Sender);
                
            void __fastcall AnExitExecute(TObject *Sender);
                
            void __fastcall PaintBox2Paint(TObject *Sender);
                
            void __fastcall Timer1Timer(TObject *Sender);
                
            void __fastcall ApplicationEvents1Deactivate(TObject *Sender);
                
            void __fastcall LabelHomeMouseEnter(TObject *Sender);
                
            void __fastcall LabelHomeMouseLeave(TObject *Sender);
                
            void __fastcall LabelHomeClick(TObject *Sender);
                
            void __fastcall AnHelpExecute(TObject *Sender);
                
            void __fastcall AnAboutExecute(TObject *Sender);
            public:
                
            static const NumScores = 5;
                #pragma pack(push,
            1)
                typedef 
            struct
                 
            {
                   
            int Score;
                   
            char Name[32];
                 }
             TScoreItem;
                typedef union
                 
            {
                   TScoreItem Scores[NumScores];
                   
            char Buffer[512];
                 }
             TTetrisParams;
                #pragma pack(pop)    
            private:    // User declarations
                __property bool Paused = { read = _bPaused, write = SetPause };

                
            bool _bPaused;
                TBaseTetris Tetris;
                TTetrisParams TetrisParams;
                Graphics::TBitmap 
            *TtBmp, *PsBmp, *OvBmp;

                
            void __fastcall SetPause(bool);
                
            void __fastcall CheckGameStatus(void);
                
            void __fastcall RefreshDisplay(void);

                
            void LoadParams(void);
                
            void SaveParams(void);
                
            void GetPlayerName(char *lpName);
                
            void ShowHighScores(void);
            public:        // User declarations
                __fastcall TFormTetris(TComponent* Owner);
                __fastcall 
            ~TFormTetris();
            }
            ;
            //---------------------------------------------------------------------------
            extern PACKAGE TFormTetris *FormTetris;
            //---------------------------------------------------------------------------
            #endif
            posted @ 2006-01-17 17:41 hacken 閱讀(309) | 評論 (0)編輯 收藏

            2006年1月16日 #

            pi
            2006年1月16日10:57:35
             
            void __fastcall TForm1::Button1Click(TObject *Sender)
            {
              
            double x=2, z=2;
              
            int a=1, b=3;
              
            while(z>1e-15)
              
            {
                z 
            = z*a/b;
                x 
            += z;
                a
            ++;
                b
            +=2;
              }

              Memo1
            ->Text = AnsiString().sprintf("Pi=%.13f", x);

            posted @ 2006-01-16 10:54 hacken 閱讀(128) | 評論 (0)編輯 收藏

            僅列出標題  下一頁
            久久亚洲高清观看| 天天久久狠狠色综合| 国产精品免费看久久久香蕉| 中文字幕无码精品亚洲资源网久久 | 欧美国产成人久久精品| 99精品国产在热久久无毒不卡| 亚洲欧美久久久久9999| 久久久久国产一级毛片高清板| 成人亚洲欧美久久久久| 91精品国产色综久久| 亚洲国产精品热久久| 久久久综合九色合综国产| 99久久99这里只有免费费精品| 久久久久亚洲AV无码麻豆| 久久亚洲AV成人出白浆无码国产| 亚洲国产另类久久久精品小说 | 久久久久久噜噜精品免费直播| 伊人久久大香线蕉影院95| 久久综合久久综合久久| 国产精品日韩深夜福利久久| 久久一区二区三区99| 偷窥少妇久久久久久久久| 久久精品国产亚洲av麻豆图片| 99久久国产精品免费一区二区| 精品国产乱码久久久久软件 | 无码人妻精品一区二区三区久久| 亚洲精品蜜桃久久久久久| av无码久久久久久不卡网站| 精品久久久久久无码中文野结衣| 久久久久久亚洲精品无码| 久久精品人人做人人爽电影| 国产成人久久精品一区二区三区| 中文字幕久久欲求不满| 久久大香萑太香蕉av| 99久久人妻无码精品系列| 久久综合狠狠综合久久97色| 精品人妻伦九区久久AAA片69| 久久精品中文字幕久久| 久久综合久久性久99毛片| 奇米影视7777久久精品| 久久精品国产只有精品66|