最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

debug tips

工作和技术 crifan 1473浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
79 queries in 0.167 seconds, using 22.09MB memory