linux常用頭文件如下: POSIX標準定義的頭文件 #include <dirent.h> // 目錄項 #include <fcntl.h> //文件控制 #include <fnmatch.h> //文件名匹配類型 #include <glob.h> // 路徑名模式匹配類型 #include <grp.h> // 組文件 #include <netdb.h> // 網絡數據庫操作 #include <pwd.h> //口令文件 #include <regex.h> //正則表達式 #include <tar.h> // TAR歸檔值 #include <termios.h> //終端I/O #include <unistd.h> // 符號常量 #include <utime.h> // 文件時間 #include <wordexp.h> // 字符擴展類型 ------------------------- #include <arpa/inet.h> // INTERNET定義 #include <net/if.h> // 套接字本地接口 #include <netinet/in.h> //INTERNET地址族 #include <netinet/tcp.h> // 傳輸控制協議定義 ------------------------- #include <sys/mman.h> //內存管理聲明 #include <sys/select.h> // Select函數 #include <sys/socket.h> // 套接字藉口 #include <sys/stat.h> // 文件狀態 #include <sys/times.h> // 進程時間 #include <sys/types.h> // 基本系統數據類型 #include <sys/un.h> // UNIX域套接字定義 #include <sys/utsname.h> // 系統名 #include <sys/wait.h> // 進程控制 ------------------------------ POSIX定義的XSI擴展頭文件 #include <cpio.h> // cpio歸檔值 #include <dlfcn.h> // 動態鏈接 #include <fmtmsg.h> // 消息顯示結構 #include <ftw.h> // 文件樹漫遊 #include <iconv.h> // 代碼集轉換使用程序 #include <langinfo.h> // 語言信息常量 #include <libgen.h> // 模式匹配函數定義 #include <monetary.h> // 貨幣類型 #include <ndbm.h> // 數據庫操作 #include <nl_types.h> // 消息類別 #include <poll.h> //輪詢函數 #include <search.h> // 搜索表 #include <strings.h> //字符串操作 #include <syslog.h> // 系統出錯日誌記錄 #include <ucontext.h> //用戶上下文 #include <ulimit.h> // 用戶限制 #include <utmpx.h> // 用戶帳戶數據庫 ----------------------------- #include <sys/ipc.h> //IPC(命名管道) #include <sys/msg.h> // 消息隊列 #include <sys/resource.h> //資源操作 #include <sys/sem.h> // 信號量 #include <sys/shm.h> //共享存儲 #include <sys/statvfs.h> // 文件系統信息 #include <sys/time.h> // 時間類型 #include <sys/timeb.h> //附加的日期和時間定義 #include <sys/uio.h> // 矢量I/O操作 ------------------------------ POSIX定義的可選頭文件 #include <aio.h> // 異步I/O #include <mqueue.h> // 消息隊列 #include <pthread.h> // 線程 #include <sched.h> //執行調度 #include <semaphore.h> //信號量 #include <spawn.h> // 實時spawn接口 #include <stropts.h> //XSI STREAMS接口 #include <trace.h> // 事件跟蹤 3、 C/C++頭文件一覽 C #include <assert.h> //設定插入點 #include <ctype.h> //字符處理 #include <errno.h> //定義錯誤碼 #include <float.h> //浮點數處理 #include <iso646.h> //對應各種運算符的宏 #include <limits.h> //定義各種數據類型最值的常量 #include <locale.h> //定義本地化C函數 #include <math.h> //定義數學函數 #include <setjmp.h> //異常處理支持 #include <signal.h> //信號機制支持 #include <stdarg.h> //不定參數列表支持 #include <stddef.h> //常用常量 #include <stdio.h> //定義輸入/輸出函數 #include <stdlib.h> //定義雜項函數及內存分配函數 #include <string.h> //字符串處理 #include <time.h> //定義關於時間的函數 #include <wchar.h> //寬字符處理及輸入/輸出 #include <wctype.h> //寬字符分類 傳統C++ #i nclude <fstream.h> //改用<fstream> #i nclude <iomanip.h> //改用<iomainip> #i nclude <iostream.h> //改用<iostream> #i nclude <strstrea.h> //該類不再支持,改用<sstream>中的stringstream ———————————————————————————————— 標準C++ #i nclude <algorithm> //STL 通用算法 #i nclude <bitset> //STL 位集容器 #i nclude <cctype> //字符處理 #i nclude <cerrno> //定義錯誤碼 #i nclude <cfloat> //浮點數處理 #i nclude <ciso646> //對應各種運算符的宏 #i nclude <climits> //定義各種數據類型最值的常量 #i nclude <clocale> //定義本地化函數 #i nclude <cmath> //定義數學函數 #i nclude <complex> //複數類 #i nclude <csignal> //信號機制支持 #i nclude <csetjmp> //異常處理支持 #i nclude <cstdarg> //不定參數列表支持 #i nclude <cstddef> //常用常量 #i nclude <cstdio> //定義輸入/輸出函數 #i nclude <cstdlib> //定義雜項函數及內存分配函數 #i nclude <cstring> //字符串處理 #i nclude <ctime> //定義關於時間的函數 #i nclude <cwchar> //寬字符處理及輸入/輸出 #i nclude <cwctype> //寬字符分類 #i nclude <deque> //STL 雙端隊列容器 #i nclude <exception> //異常處理類 #i nclude <fstream> //文件輸入/輸出 #i nclude <al> //STL 定義運算函數(代替運算符) #i nclude <limits> //定義各種數據類型最值常量 #i nclude <list> //STL 線性列表容器 #i nclude <locale> //本地化特定信息 #i nclude <map> //STL 映射容器 #i nclude <memory> //STL通過分配器進行的內存分配 #i nclude <new> //動態內存分配 #i nclude <numeric> //STL常用的數字操作 #i nclude <iomanip> //參數化輸入/輸出 #i nclude <ios> //基本輸入/輸出支持 #i nclude <iosfwd> //輸入/輸出系統使用的前置聲明 #i nclude <iostream> //數據流輸入/輸出 #i nclude <istream> //基本輸入流 #i nclude <iterator> //STL迭代器 #i nclude <ostream> //基本輸出流 #i nclude <queue> //STL 隊列容器 #i nclude <set> //STL 集合容器 #i nclude <sstream> //基於字符串的流 #i nclude <stack> //STL 堆棧容器 #i nclude <stdexcept> //標準異常類 #i nclude <streambuf> //底層輸入/輸出支持 #i nclude <string> //字符串類 #i nclude <typeinfo> //運行期間類型信息 #i nclude <utility> //STL 通用模板類 #i nclude <valarray> //對包含值的數組的操作 #i nclude <vector> //STL 動態數組容器 ———————————————————————————————— C99增加的部分 #i nclude <complex.h> //複數處理 #i nclude <fenv.h> //浮點環境 #i nclude <inttypes.h> //整數格式轉換 #i nclude <stdbool.h> //布爾環境 #i nclude <stdint.h> //整型環境 #i nclude <tgmath.h> //通用類型數學宏