• <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 閱讀(207) 評論(0)  編輯 收藏 引用 所屬分類: c/c++
            <2009年6月>
            31123456
            78910111213
            14151617181920
            21222324252627
            2829301234
            567891011

            "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

            搜索

            •  

            最新評論

            評論排行榜

            浪潮AV色综合久久天堂| 久久精品国产亚洲77777| 久久久精品国产Sm最大网站| 国产香蕉97碰碰久久人人| 久久精品国产亚洲av瑜伽| 久久久www免费人成精品| 久久久无码精品亚洲日韩蜜臀浪潮 | 久久久久国产精品熟女影院 | 亚洲国产天堂久久综合| 人妻丰满AV无码久久不卡| 国产精品gz久久久| 久久久精品2019免费观看| 亚洲&#228;v永久无码精品天堂久久| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 久久99热只有频精品8| 久久青青草原精品国产不卡| 久久久久久久女国产乱让韩| 91久久成人免费| 久久久无码精品亚洲日韩按摩 | 国产精品九九久久免费视频| 无码精品久久久天天影视| 久久www免费人成精品香蕉| 久久66热人妻偷产精品9| 久久久久国产精品嫩草影院| 久久久精品日本一区二区三区| 国产高潮国产高潮久久久| 国产aⅴ激情无码久久| 久久这里的只有是精品23| 久久久久久亚洲精品无码| 狠狠人妻久久久久久综合蜜桃| 久久亚洲精品成人AV| 欧美牲交A欧牲交aⅴ久久| 久久久久久亚洲精品影院| 亚洲精品成人久久久| 久久天天躁狠狠躁夜夜2020 | 亚洲性久久久影院| 欧美日韩久久中文字幕| 亚洲国产成人久久综合一区77| 日本国产精品久久| 亚洲国产成人精品91久久久| 色欲综合久久躁天天躁|