Crane
Table_bottom

Search
Loading
Table_bottom

分类
Table_bottom

随机文章
Table_bottom

标签云
Table_bottom

最新评论
Table_bottom

链接
Table_bottom

功能
Table_bottom

C语言有点变态

Crane posted @ 2009年6月20日 23:57 in Linux with tags Trick 编程 c , 12743 阅读

直接看这个程序

 

#include<stdio.h>
int f(int x)
{
        printf("%d\n",x);
}
int main(void)
{
        int (*pf)(int);
        pf=f;   //正常用法
        pf(5);
        (**pf)(5);      //这是什么
        (****************f)(5)//这个变态啊
        pf=&f;  //这个也没问题
        pf(6);
        pf=*****f;      //这是干什么
        pf(7);
        system("pause");
        return 0;
}

看着很神奇,至少有些我从来没那样写过,但是这些全部是合法的,可以编译通过。

 

luciux 说:
2014年2月28日 05:12

这没什么难的吧,听说过 “顺时针螺旋法则”吗? 好好搜一下。


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter