• <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++博客 首頁 新隨筆 聯(lián)系 聚合 管理
              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 閱讀(115) | 評論 (0)編輯 收藏

            2006年2月28日 #

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

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

            2006年1月24日 #

             

            int (*hacken)(int a,double b);
            是一個指向函數(shù)的指針,可以給它賦值如下:
            int (*hacken)();
            hacken
            =sin;
            其中sin是一個函數(shù)名。
            posted @ 2006-01-24 16:24 hacken 閱讀(217) | 評論 (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日
            怎么樣理解這個程序,有關(guān)其中的運(yùn)算怎么做?
            posted @ 2006-01-21 17:00 hacken 閱讀(202) | 評論 (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;
            }
                   
            他的結(jié)果是:abcd
                                    efghi
            怎么出來efghi的,我知道應(yīng)該是d字符加1就是e ,但有點(diǎn)不懂,希望大家?guī)椭摇?BR>謝謝。
            17:17:01
            2006年1月20日
            posted @ 2006-01-20 17:17 hacken 閱讀(344) | 評論 (2)編輯 收藏

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

            僅列出標(biāo)題  下一頁
            国产精品久久久久9999高清| 久久伊人色| 日本道色综合久久影院| 久久午夜无码鲁丝片秋霞 | 伊人久久五月天| 久久亚洲私人国产精品| 久久久久久曰本AV免费免费| 成人国内精品久久久久影院| 青青草原综合久久大伊人导航| 久久99国产综合精品女同| 亚洲精品综合久久| 久久久久久久99精品免费观看| 综合久久一区二区三区 | 色综合久久久久综合体桃花网| 亚洲嫩草影院久久精品| 亚洲AV成人无码久久精品老人| 久久久久无码专区亚洲av| 国产精品一区二区久久国产| 亚洲午夜福利精品久久| 国产L精品国产亚洲区久久| 浪潮AV色综合久久天堂| 久久久一本精品99久久精品88| 久久精品成人欧美大片| 久久99精品国产麻豆宅宅| 午夜精品久久久久久毛片| 三级片免费观看久久| 久久久这里有精品中文字幕| 91久久精品国产91性色也| 狠狠狠色丁香婷婷综合久久五月| 一本一道久久综合狠狠老| 久久毛片一区二区| 综合久久给合久久狠狠狠97色 | 欧美日韩精品久久久久| 怡红院日本一道日本久久| 韩国无遮挡三级久久| 国产精品久久99| 久久久国产精品网站| 99久久免费国产特黄| 国产精品久久久久久一区二区三区| 久久99热只有频精品8| 久久AV高清无码|