29
2015年7月16日 星期四
[C] assert
›
維護(assertion)敘述 當自己寫的函式庫要提供他人使用時,適當的利用維護敘述,可以建立安全的使用 介面,避免他人因為使用不當,而造成不可預期的後果。 C 語言有自己的維護函式- assert() ,...
[C] gets
›
gets與scanf 功能都是讀入字元, 但scanf不吃空白, 即如果輸入 "Lam with c", scanf只會讀入"Lam" , 遇到空白後的字一概不理; 相反地 , gets 可以讀入埋空白後面的字. ...
[C] 二維陣列(char)
›
1) you can use 2D char array in this way char name [ 5 ][ 100 ]; each line in the 2D array is an array of char with size = 100 for ( ...
2015年6月30日 星期二
[C] vs2013 解決不能正常使用 scanf,strlen 等函數問題
›
R-click your project and click the properties option , do the same things with the illustration.
2015年6月7日 星期日
[C] %s 的使用
›
當使用 %s 於 printf 和 scanf 時, 對應的argument 必須是 char * , 如下列例子: char * str_constant = "I point to a string literal" ; char ...
2015年6月1日 星期一
[C] auto 與 register
›
C語言變數 儲存等級(storage class) ,一共有四種: auto、extern、register、static ,我們最常用的是 auto ,然而卻很少人用它來宣告變數,怎麼說起來很奇怪?因為 編譯器自動把我們宣告的變數自動設成auto ,只是我們都忽略有這回事。...
[C] static 與 extern
›
static 變數,當變數有宣告時加上static限定時,一但變數生成,它就會 一直存在記憶體之中 ,即使函式執行完畢,變數也不會消失,例如: #include <stdio.h> void count ( void ); int main ...
‹
›
首頁
查看網路版