• <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>
            posts - 43,  comments - 9,  trackbacks - 0
            void (*signal(int, void (*fp)(int)))(int); 
            Question:
            What is 'signal' ?
             
            #include <cstdio>
            using namespace std;

            void f(int);
            void (*pf)(int), (*qf)(int);
            void (*hf(intvoid(*)(int)))(int);

            typedef 
            void (*sighandler_t)(int);

            sighandler_t signal(
            int, sighandler_t);


            void f(int a) 
            {
                printf(
            "void f(int %d)\n", a);
            }


            void (*hf(int _i, void(*_pf)(int)))(int)
            {
                printf(
            "_i = %d\n", _i);
                _pf(_i);
                
            return _pf;
            }


            sighandler_t signal(
            int signum, sighandler_t sighandler)
            {
                printf(
            "signal num = %d\n", signum);
                sighandler(signum);
                
            return sighandler;
            }


            int main()
            {
                pf 
            = &f;
                qf 
            = hf(12, pf);
                qf(
            23);
                
                signal(
            54, f);
                
            return 0;
            }



            void (*signal(int, void (*)(int)))(int);
            Answer:
            signal is a function, passing {an int and a pointer [to a function passing an int returning nothing (void)]}, returning {a pointer [to a function passing an int returning nothing (void)]}.

            posted on 2011-08-31 13:07 wolf5x 閱讀(218) 評論(0)  編輯 收藏 引用 所屬分類: c/c++
            <2025年8月>
            272829303112
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            "Do not spend all your time on training or studying - this way you will probably become very exhausted and unwilling to compete more. Whatever you do - have fun. Once you find programming is no fun anymore – drop it. Play soccer, find a girlfriend, study something not related to programming, just live a life - programming contests are only programming contests, and nothing more. Don't let them become your life - for your life is much more interesting and colorful." -- Petr

            留言簿(3)

            隨筆分類(59)

            隨筆檔案(43)

            cows

            搜索

            •  

            最新評論

            評論排行榜

            国产91久久综合| 青青草国产精品久久久久| 伊人久久大香线蕉精品| 国产成人精品久久亚洲| 伊人久久大香线蕉综合5g| 久久亚洲私人国产精品| 99精品久久精品| 久久强奷乱码老熟女| 久久男人Av资源网站无码软件| 99国产精品久久| 亚洲国产精品综合久久网络| 久久久精品2019免费观看| 国产精品无码久久久久| 亚洲精品乱码久久久久久蜜桃图片| 久久不射电影网| 亚洲精品无码久久久久去q | 久久99热精品| 亚洲欧美精品一区久久中文字幕 | 精品久久久久中文字幕日本| 久久亚洲高清综合| 久久99热精品| 久久偷看各类wc女厕嘘嘘| 日韩AV毛片精品久久久| 国产精品99久久久久久董美香| 一本一本久久aa综合精品| 欧美粉嫩小泬久久久久久久| 91精品国产91热久久久久福利| 人人狠狠综合久久88成人| 伊人热热久久原色播放www | 久久久久噜噜噜亚洲熟女综合 | 国产精品九九久久免费视频 | 亚洲综合伊人久久综合| 亚洲精品无码久久毛片 | 亚洲国产精品无码久久久久久曰| 91久久国产视频| 7国产欧美日韩综合天堂中文久久久久 | 欧美一区二区久久精品| 久久精品免费大片国产大片| 久久久中文字幕| 91精品国产高清久久久久久91| 国产欧美久久久精品|