/* atof example: sine calculator */
#include /* printf, fgets */
#include /* atof */
#include /* sin */
#define vfd_com_timeout_clear() dowhile(0)
#define vfd_com_timeout_recount() dowhile(0)
/*判斷等待時間是否超時
*/int is_eload_com_timeout(void)
else
}int main ()
; int vfd_com_cnt = 5;
printf("vfd_com_cnt = %d\n",vfd_com_cnt);
vfd_com_timeout_clear();
printf("vfd_com_cnt = %d\n",vfd_com_cnt);
if (!is_eload_com_timeout())
else
n = atof (buffer);
printf("n=%f\n", n);
m = sin (n * pi / 180);
printf ("the sine of %f degrees is %f\n", n, m);
return 0;
}int is_eload_com_timeout(void)
else
}int main ()
; int vfd_com_cnt = 5;
printf("vfd_com_cnt = %d\n",vfd_com_cnt);
dowhile(0);
printf("vfd_com_cnt = %d\n",vfd_com_cnt);
if (!is_eload_com_timeout())
else
n = atof (buffer);
printf("n=%f\n", n);
m = sin (n * pi / 180);
printf ("the sine of %f degrees is %f\n", n, m);
return 0;
}
上文已經就將源**和預編譯後的比分文字合作一起了。
#define vfd_com_timeout_clear() dowhile(0)
這個**我起初以為會有問題,應為括號裡面是空的,
但是使用gcc -e .\atofc.c -o atofc.i後,發現直接替換了,因此該方法可以使用。
但是注意,巨集定義不檢查語法的,因此寫巨集定義的時候要格外小心。
乙個小技巧
下午去牙科看牙,順便幫我媽把鞋上個鞋絆。修鞋的老太太慈眉善目,於是跟她攀談起來。我問她,您看這鞋怎麼樣啊?老太太瞅瞅鞋,笑笑不說話。我又說,這是在沂蒙大樓專櫃買的,打折處理的 款,也不知道質量怎麼樣。老太太嗯嗯幾聲,還是不言語。一邊修著鞋,老太太看我態度還算虛心,就跟我傳授了經驗。大意就是,專櫃處理...
VIM ctags的乙個小技巧
vim可以使用ctags製作的tags檔案來瀏覽程式原始檔。問題是,當原始檔存放在目錄樹 也就是所謂的source tree 的時候,該怎麼辦呢?在預設情況下,ctags只會處理當前目錄裡的原始檔,而且vim也只會參考當前目錄的tags檔案。這時候,如果當前目錄裡的原始檔引用了其他目錄裡的定義,那麼...
tomcat的乙個小技巧
tomcat進入manage管理介面的方法.1,進入到tomcat檔案加然後進去找到conf資料夾裡面的tomcat user.xml檔案 2.用記事本開啟。3.要想進入到manage的管理頁面,首先新增乙個管理員角色 然後寫上你想要輸入的使用者名稱或者密碼即可 這樣就可以用從管理的manage裡面...