匯總 C 標準庫、DOS 擴展庫、conio.h 中以 H 開頭 的函數,含原型、功能、頭文件、示例與現代替代提示。
#include
void harderr(int (*handler)(int errval, int ax, int bp, int si));
// 設置 INT 24H (關鍵錯誤中斷) 處理函數。
// handler 參數:errval(錯誤值), ax(驅動器/操作), bp, si(設備參數)。
// 返回值:0=忽略, 1=重試, 2=中止, 3=失敗(某些版本)。
// 僅限 DOS 實模式。現代 OS 內核處理硬件錯誤,用戶態無需/不可攔截。
#include
void hardresume(int action);
// 在 harderr handler 內調用,通過 DOS 系統調用 (INT 21H) 返回錯誤處理結果。
// action: 0=忽略, 1=重試, 2=中止, 3=失敗。
// 配合 harderr 使用,實現「中止/重試/忽略」交互。
#include
void highvideo(void);
// 設置後續輸出字符為高亮屬性(前景色增強)。
// 配合 lowvideo(), normvideo() 使用。僅限文本模式視口。
int main() {
clrscr();
lowvideo(); cprintf("Low intensity\n");
highvideo(); cprintf("High intensity\n");
normvideo();
}
#include
double hypot(double x, double y);
// 返回 sqrt(x*x + y*y),避免中間溢出/下溢。
// C99 標準函數。對應複數模長 cabs。
int main() {
printf("hypot(3,4) = %f\n", hypot(3,4)); // 5.0
}
| 舊函數 | 現代替代 | 頭文件/庫 | 備註 |
|---|---|---|---|
| harderr/hardresume | 無 (內核處理) | - | DOS 獨有,現代 OS 不暴露 |
| highvideo/lowvideo/normvideo | ANSI SGR \033[1m(亮)/\033[2m(暗)/\033[0m(重置) | stdio.h | 跨平台終端屬性控制 |
| hypot | hypot (C99 標準保留) | math.h | 編譯加 -lm,避免溢出的健壯實現 |
hypotf/hypotl:float/long double 版本 (C99)。hcreate/hdestroy/hsearch:哈希表搜索 (POSIX, <search.h>)。htonl/htons/ntohl/ntohs:網絡/主機字節序轉換 (<arpa/inet.h>)。halloc/hfree:巨型模型堆分配 (DOS, 遠指標)。