hope_process
heixia108_cu
全部博文(61)
oldlinux(0)
Perl(1)
学习资料(0)
Enhlish(0)
心情(5)
Windows(0)
硬件相关(0)
软件工程(0)
数据挖掘与AI(0)
OpenGL(1)
2009年(2)
2008年(59)
Bsolar
zhanghan
anhuiwen
luoqeng
分类: C/C++
2008-03-12 10:48:48
#include <math.h> #include <stdio.h> #include <stdlib.h> struct init { char *fname; double (*fnct)(double); }; struct init arith_fncts[] = { {"sin",sin}, {"cos",cos}, {"tan",tan}, {"log",log}, {"exp",exp}, {"sqrt",sqrt}, {0,0} }; int main() { struct init *p; *p = arith_fncts[0]; /* 错误就在这!!! * change ==>
* p = &arith_fncts[0]; */ printf("sin:%g\n",(*(p->fnct))(1.2)); return 0; }
* p =
&
arith_fncts[0];
*/
printf("sin:%g\n",(*(p->fnct))(1.2)); return 0; }
上一篇:sed 用法介绍
下一篇:获取网页源码
登录 注册