g****t 发帖数: 31659 | 1 【 以下文字转载自 EE 讨论区 】
发信人: guvest (我爱你老婆Anna), 信区: EE
标 题: local = (char *(*)()) inc_1; 是啥意思?
发信站: BBS 未名空间站 (Thu Jul 15 22:18:06 2010, 美东)
发信人: platinumegg (蛋,纯铂金的), 信区: Military
标 题: Re: 岳东晓知识产权案获胜
发信站: BBS 未名空间站 (Thu Jul 15 16:20:11 2010, 美东)
hahaha, see the link below for how it was discussed by people.
http://www.worldlawdirect.com/forum/copyright-trademark-patent/38860-fenwick-west-llp-loses-copyright-jury-trial.html
"Wonder how many millions Chordiant spent on Fenwick & West LLP to get thi | I**********s 发帖数: 441 | 2 local = (char *(*)()) inc_1;
char *(*)() is the pointer to a function.
This function takes no argument and return type is char *.
So the above statement casts inc_1 to the type of char *(*)()
and assign it to function pointer local.
"C traps and pitfalls" has an example like this:
(* (void (*) ()) 0)();
What this does is to cast address 0 as a function pointer void (*) (),
which is a function takes no argument and return type is void.
It then dereference this pointer and execute it.
This is used |
|