• <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 閱讀(219) 評論(0)  編輯 收藏 引用 所屬分類: c/c++
            <2011年8月>
            31123456
            78910111213
            14151617181920
            21222324252627
            28293031123
            45678910

            "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

            搜索

            •  

            最新評論

            評論排行榜

            久久99精品九九九久久婷婷| 午夜视频久久久久一区| 久久综合香蕉国产蜜臀AV| 无码精品久久久天天影视| 久久亚洲私人国产精品| 久久99国产精一区二区三区| 久久www免费人成看国产片| 亚洲午夜福利精品久久 | 97精品伊人久久大香线蕉app| 九九久久99综合一区二区| 久久99亚洲综合精品首页| 精品综合久久久久久98| 丁香五月综合久久激情| 伊色综合久久之综合久久| 99国产欧美久久久精品蜜芽| 亚洲欧美国产日韩综合久久| 嫩草影院久久国产精品| 亚洲精品tv久久久久久久久| 精品久久久无码中文字幕天天| 99久久99久久精品国产片果冻 | 国产成人久久777777| 亚洲伊人久久大香线蕉综合图片| 99精品伊人久久久大香线蕉| 亚洲国产精品无码久久一线| 久久亚洲精品无码播放| 伊人久久免费视频| 99久久精品国产高清一区二区 | 久久精品中文字幕有码| 久久久久人妻精品一区二区三区 | 色综合久久中文色婷婷| 996久久国产精品线观看| 久久亚洲AV成人出白浆无码国产 | 亚洲国产精品人久久| 亚洲午夜久久久久久久久久| 一本色综合久久| 四虎国产精品成人免费久久| 久久久久久亚洲精品不卡| 国产精品成人久久久久三级午夜电影| 丁香狠狠色婷婷久久综合| 91精品国产综合久久精品| 久久最新精品国产|