posts - 43,  comments - 9,  trackbacks - 0
 1 #include<iostream>
 2 using namespace std;
 3  
 4 #define DF(N) void N(){\
 5    cout<<"function " #N " called..."<<endl;}
 6  
 7 DF(a)DF(b)DF(c)DF(d)DF(e)DF(f)
 8  
 9 void (*func_table[])()={a,b,c,d,e,f};
10 
11 int main(){
12     for(int i=0; i<6; i++){
13         (func_table[i])();
14     }
15     return 0;
16 }

posted on 2009-06-10 11:30 wolf5x 阅读(120) 评论(0)  编辑 收藏 引用 所属分类: c/c++

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理


<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

"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

搜索

  •  

最新评论

评论排行榜