__PRETTY_FUNCTION__,__func__,__FUNCTION__】的更多相关文章

今天在看苹果的官方demo的时候,发现这个打印调用方法的参数,很是好奇,遂bing了一番. NSLog(@"----------------%s",__PRETTY_FUNCTION__); NSLog(@"%s",__func__); NSLog(@"%s",__FUNCTION__); 在Xcode里面,这三个的功能是一样的,都是打印当前方法的调用的. 2015-05-30 14:21:48.580 CustomAnimatablePrope…
vs项目中见过这种获取 当前函数名的调用.觉得挺方便的就记录一下. ============================================================== 转载地址:http://blog.csdn.net/dafan/article/details/5781491 __FILE____LINE____DATE____TIME____FUNC__ __FUNCTION__ 在Visual Studio 2005中,默认情况下,此特性是激活的,但不能与/EP和…
在iOS开发过程中,调试是很重要的过程,而除了各种断点调试(普通断点.条件断点.全局断点)之外,似乎NSLog是我们调试最常用的方法,当然,也是最简单朴素的寻debug方法. 在项目中,我们常使用的NSLog的语句无外乎以下一种: NSLog(@"打印字符串:%@",name); NSLog(@"打印整形:%i",number);//或者 %li ; %ld ; %d NSLog(@"打印字符:%c",c); NSLog(@"打印单浮点…
#ifdef DEBUG #define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); #else #define DLog(...) #endif DLog的使用 Objective C中NSLog虽然使用方便,但是有时候NSLog并不能满足程序员调试程序的全部需求.比如打印的结果位于哪个类中?是在哪个类中打印的?或者具体是在哪行打印的等等.所以对…
链接:http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html#Function-Names GCC provides three magic variables that hold the name of the current function, as a string. The first of these is __func__, which is part of the C99 standard: The identifier __fu…
6.47 Function Names as Strings:http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html GCC provides three magic variables that hold the name of the current function, as a string. The first of these is __func__, which is part of the C99 standard: The id…
[Function Names as Strings] GCC provides three magic variables that hold the name of the current function, as a string. The first of these is __func__, which is part of the C99 standard(old): The identifier __func__ is implicitly declared by the tran…
构造函数   任何一们面向对象语言里都会涉及构造函数这一概念,只是实现的方式各有差异.需要这main函数之前执行一段代码是非常容易的事情,只需要声明一对象的全局变量,在构造函数可以为所欲为干你想干的事情.然而,对于面向过程的语言比如C,需要实现全局的构造函数就比较奇葩.当然gcc会有很优雅的解决方式,VC则猥琐点. 为何需要这个   其实在main函数里面调用一下就可以了,是的,这样是可以,但是对于框架的实现来说,这却是不太好的,客户使用起来不自由.当然也可以说,我是屌丝,我可以装逼点. 如何实…
C++Builder debug 程序的时候, deub一个变量 dm->avar; E2288 Pointer to structure required on left side of -> or ->* 调试获取函数名,行号,文件名. __FILE____LINE____DATE____TIME____FUNC__ __FUNCTION__…
__FILE__   对应代码文件名__LINE__   对应代码行号__DATE____TIME____FUNC__ __FUNCTION__ 在Visual Studio 2005中,默认情况下,此特性是激活的,但不能与/EP和/P编译选项同时使用.请注意在IDE环境中,不能识别__func__ ,而要用__FUNCTION__ 代替. Comeau的用户也应使用 __FUNCTION__ ,而不是 __func__ . C++ BuilderX的用户则应使用稍稍不同的名字:__FUNC__…