由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
CS版 - local = (char *(*)()) inc_1; 是啥意思?
相关主题
哪位大牛推荐一本C++的书?C++ 初级再初级问题 (转载)
Where to find next Google20个包子求帮忙把命令行模式C程序改成窗口界面的 (转载)
问个char *的问题One question about Void pointer (转载)
Help for C languageVC++ 里函数调用指针的问题
贴一道take home的面试题java reference 问题
问一个C++函数Parameter的问题请教怎么用#define实现如下的功能
问一个简单的C的问题一个程序的小问题
NetFlix prize : SVD: C++ code problemWanna discuss "autonomic computing"?
相关话题的讨论汇总
话题: char话题: inc话题: local话题: function话题: pointer
进入CS版参与讨论
1 (共1页)
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
1 (共1页)
进入CS版参与讨论
相关主题
Wanna discuss "autonomic computing"?贴一道take home的面试题
new board 4 latex discussion问一个C++函数Parameter的问题
Competing for ideas is everywhere问一个简单的C的问题
off-topic nowNetFlix prize : SVD: C++ code problem
哪位大牛推荐一本C++的书?C++ 初级再初级问题 (转载)
Where to find next Google20个包子求帮忙把命令行模式C程序改成窗口界面的 (转载)
问个char *的问题One question about Void pointer (转载)
Help for C languageVC++ 里函数调用指针的问题
相关话题的讨论汇总
话题: char话题: inc话题: local话题: function话题: pointer