社区
Linux/Unix社区
帖子详情
Is it possible to get the caller's name in C ?
Way79
2004-08-20 06:52:53
thanks for any help
...全文
83
7
打赏
收藏
Is it possible to get the caller's name in C ?
thanks for any help
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
softcar
2004-08-20
打赏
举报
回复
比较难。
sah
2004-08-20
打赏
举报
回复
好像挺难。如果可以,那不就乱套了?因为违反了“调用”的概念啊。可能得设一个个参数,或者全局变量来标志吧?这是我的想法,供你参考。
铖邑
2004-08-20
打赏
举报
回复
what?
pacman2000
2004-08-20
打赏
举报
回复
no name!
tianxiangyuan
2004-08-20
打赏
举报
回复
no
blh
2004-08-20
打赏
举报
回复
If you use the compiler that accords with the c99 stardard, you shall implement it by the following means:
//called function:
int test_func_trace(const char* caller_name, int n);
#define test_func(n) test_func_trace(__func__, (n))
//caller function:
int test()
{
return test_func(100);
}
沙沙的吹
2004-08-20
打赏
举报
回复
C不提供这个机制吧。不过也许有编译器提供这个功能也说不定,也许你在调用调用的时候,将名字用参数传递进去是可以的。
06 Frequently Asked Questions (FAQ) 常见问题解答 (常见问题)
Frequently Asked Questions (FAQ) Origins起源What is the pur
po
se of the project?What is the history of the ...What's the origin of the goph
er
mascot?Why did you create a new language?What ...
Memory management in C programs
One large diff
er
ence between C and most oth
er
programming languages is that in C, you have to handle memory yourself rath
er
than having a garbage collector do it for you. Ensuring that memory is alloc
职业综合英语 章节答案考试答案 深圳职业技术学院[渝粤教育]
1、【判断题】 Google is the world’s most
po
pular website. A、正确 B、错误 参考资料【 】 2、【判断题】Larry Page set up Google in January 1996 at Stanford. A、正确 B、错误 参考资料【 】 3、【判断题】...
Beej's Quick Guide to GDB
Beej's Quick Guide to GDB Release 2 (2009 Jun ...This is a v
er
y quick-and-dirty guide meant to get you started with the GNU Debugg
er
, gdb, from the command line in a t
er
minal. Often times gdb is run
Learning C from Java
This is a list of diff
er
ences between Java and C, and assumes that the read
er
knows less about the latt
er
. It's worth familiarising yourself with all the
po
ints, even if you don't fully und
er
stand the
Linux/Unix社区
23,116
社区成员
74,506
社区内容
发帖
与我相关
我的任务
Linux/Unix社区
Linux/Unix社区 应用程序开发区
复制链接
扫一扫
分享
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章