函式名 | 所需之標頭檔 | 簡便使用方法 | 備註 |
printf() | stdio.h | printf("字串", 參數... ) | 列印函式 |
scanf() | stdio.h | scanf("字串", 參數... ) | 鍵盤輸入函式,請注意 "&" |
pow() | math.h | pow(x, y) | x 的 y 次方,傳回值為 double |
floor() | math.h | floor(x) | 取小於 x 的最大整數,x為double,如:floor(3.14)=3。 |
ceil() | math.h | ceil(x) | 取大於 x 的最小整數,如:ceil(3.14)=4。 |
sqrt() | math.h | sqrt(x) | 把 x 開根號 |
strlen() | string.h | strlen(字串的名字) | 計算字串資料的長度。 |
strcmp | string.h | strcmp(字串1, 字串2) | 比較兩個字串的異同。傳回值為 0 時,兩字串相同;反之,則不相同。 |
strcpy | string.h | strcpy(字串1, 字串2) | 將字串2 拷貝一份到字串1。 原來在字串1 的資料將會覆蓋而消失。 |
沒有留言:
張貼留言