• <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

            搜索

            •  

            最新評論

            評論排行榜

            男女久久久国产一区二区三区| 久久综合九色综合网站| 久久久久免费精品国产| 久久免费线看线看| 久久亚洲精品国产亚洲老地址| 99精品国产综合久久久久五月天| 9久久9久久精品| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 国产成人综合久久精品红| 久久婷婷国产综合精品| 久久精品夜色噜噜亚洲A∨| 亚洲国产成人久久精品99 | 热久久这里只有精品| 一级a性色生活片久久无少妇一级婬片免费放 | 国产成人无码久久久精品一| 91亚洲国产成人久久精品| 无码久久精品国产亚洲Av影片| 99久久成人18免费网站| 久久久久久国产精品免费无码| 久久不见久久见免费影院www日本| 无码精品久久久天天影视| 人人狠狠综合久久亚洲高清| 精品一区二区久久| 久久久一本精品99久久精品88| 久久夜色撩人精品国产| 国产精品VIDEOSSEX久久发布| 久久久婷婷五月亚洲97号色| 99久久这里只精品国产免费| 久久精品中文字幕第23页| 99久久精品免费看国产| 久久99久久99小草精品免视看| 日韩精品久久无码中文字幕| 亚洲AV无码久久精品色欲| 97久久国产综合精品女不卡| 日本五月天婷久久网站| 亚洲人成精品久久久久| 久久精品成人影院| 99热热久久这里只有精品68| 日本道色综合久久影院| 精品免费久久久久国产一区| 国产高清国内精品福利99久久|