• <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 閱讀(206) 評論(0)  編輯 收藏 引用 所屬分類: c/c++
            <2009年12月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            "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

            搜索

            •  

            最新評論

            評論排行榜

            日本精品久久久久中文字幕8| 狠狠色综合网站久久久久久久| 久久久久人妻一区精品| 久久亚洲国产成人影院网站| 亚洲精品无码久久一线| 久久精品国产色蜜蜜麻豆| 欧美久久久久久精选9999| 久久久无码精品亚洲日韩软件| 久久精品国产亚洲精品| 久久久亚洲裙底偷窥综合| 久久久噜噜噜久久中文字幕色伊伊| 色老头网站久久网| 亚洲人成网站999久久久综合| 久久香蕉国产线看观看乱码| 亚洲人成无码www久久久| 久久最新精品国产| 久久久久亚洲av综合波多野结衣 | 97香蕉久久夜色精品国产| 国内精品久久久久久久影视麻豆| 精品国产乱码久久久久软件| 久久国产亚洲精品麻豆| 久久久久AV综合网成人| 国产成人精品久久| 久久天天婷婷五月俺也去| 99久久夜色精品国产网站| 青青热久久国产久精品| 青青青国产精品国产精品久久久久 | 嫩草伊人久久精品少妇AV| 日韩av无码久久精品免费| 久久久国产视频| 人人狠狠综合久久亚洲高清| 伊人色综合久久| 国产精品美女久久久免费| 99久久99久久精品国产片| 国产成人综合久久综合| 久久精品无码一区二区app| 999久久久免费国产精品播放| 国产高潮国产高潮久久久91| 久久99免费视频| 99久久精品免费看国产| 999久久久免费国产精品播放|