最新消息:20210917 已从crifan.com换到crifan.org

debug tips

工作和技术 crifan 1270浏览 0评论

we can use

__FUNCTION__   = a system macro ,that is the current function name

and

__LINE__            = a system macro ,that is the current line in the current function

to affiliate our debug . ^_^

for example :

printf("Error in func: %s,line :%d .n",__FUNCTION__,__LINE__);

and we can go further to do like this for efficiently debug :

#define DEBUG() printf("Error in func: %s,line :%d .n",__FUNCTION__,__LINE__)

then ,we can use it in our function :

infile=fopen(infilename,"rb");

if(NULL==infile)

    DEBUG;

转载请注明:在路上 » debug tips

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.654 seconds, using 20.11MB memory