最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

debug tips

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

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
56 queries in 0.245 seconds, using 18.82MB memory