把在 Linux 上一些 debug 時常用到的語法寫出來,免的日後忘記...

 

1. void Debug()

2. {

3.     printf("Fucntion name = %s\n", __PRETTY_FUNCTION__);

4.     printf("Line = %d, File = %s\n", __LINE__, __FILE__); 

5. }

 

 

__PRETTY_FUNCTION__: function name, ex: Debug

__LINE__ : line number, ex: 4

__FILE__ : file name, ex: C:\test.c

文章標籤
全站熱搜
創作者介紹
創作者 xfire 的頭像
xfire

xfire

xfire 發表在 痞客邦 留言(0) 人氣(0)