#include "stdafx.h"
#include <stdio.h>

int main()
{
    const short int c1 = 49920;
    const int c2 = 1073742008;

    //
直接定义函数指针 
    //int (*pf)() = (int (*)())&c2; 其实就是把局部变量当作代码来执行
    int/*
函数返回类型*/ (*pf/*函数指针名字*/)(/*参数为空*/) = (int (*)())/*强制类型转换成函数指针*/&/*取变量地址*/c2;
    printf("%c%c\n", *(char*)pf()-19, *((char*)pf()+1)-49);
    return 0;
}

posted on 2010-06-13 20:08  o无尘o  阅读(232)  评论(0编辑  收藏  举报