1. C語言中都有哪些常用頭文件
常用的頭文件如下
#include <assert.h> //設定插入點
#include <ctype.h> //字元處理
#include <errno.h> //定義錯誤碼
#include <float.h> //浮點數處理
#include <fstream.h> //文件輸入/輸出
#include <iomanip.h> //參數化輸入/輸出
#include <iostream.h> //數據流輸入/輸出
#include <limits.h> //定義各種數據類型最值常量
#include <locale.h> //定義本地化函數
#include <math.h> //定義數學函數
#include <stdio.h> //定義輸入/輸出函數
#include <stdlib.h> //定義雜項函數及內存分配函數
#include <string.h> //字元串處理
#include <strstrea.h> //基於數組的輸入/輸出
#include <time.h> //定義關於時間的函數
#include <wchar.h> //寬字元處理及輸入/輸出
#include <wctype.h> //寬字元分類
標准 C/C++ (同上的不再注釋)
#include <algorithm> //STL 通用演算法
#include <bitset> //STL 位集容器
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex> //復數類
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque> //STL 雙端隊列容器
#include <exception> //異常處理類
#include <fstream>
#include <functional> //STL 定義運算函數(代替運算符)
#include <limits>
#include <list> //STL 線性列表容器
#include <map> //STL 映射容器
#include <iomanip>
#include <ios> //基本輸入/輸出支持
#include <iosfwd> //輸入/輸出系統使用的前置聲明
#include <iostream>
#include <istream> //基本輸入流
#include <ostream> //基本輸出流
#include <queue> //STL 隊列容器
#include <set> //STL 集合容器
#include <sstream> //基於字元串的流
#include <stack> //STL 堆棧容器
#include <stdexcept> //標准異常類
#include <streambuf> //底層輸入/輸出支持
#include <string> //字元串類
#include <utility> //STL 通用模板類
#include <vector> //STL 動態數組容器
#include <cwchar>
#include <cwctype>
using namespace std;
//////////////////////////////////////////////////////////////////////////
C99 增加
#include <complex.h> //復數處理
#include <fenv.h> //浮點環境
#include <inttypes.h> //整數格式轉換
#include <stdbool.h> //布爾環境
#include <stdint.h> //整型環境
#include <tgmath.h> //通用類型數學宏
2. 大多數c語言程序都要包含什麼頭文件
stdio.h,包含標准輸入輸出,向屏幕的輸出,文件的讀寫。
stdlib.h,標准庫文件,包含操作系統命令,隨機數,時間函數,等等。
math.h,包括各種數學函數
string.h,字元串的有關函數。
3. c語言頭文件大全
在安裝C語言程序的文件夾D:\VC98\Include裡面全部都是頭文件,下面是一部分:
#include <assert.h> //設定插入點
#include <ctype.h> //字元處理
#include <errno.h> //定義錯誤碼
#include <float.h> //浮點數處理
#include <fstream.h> //文件輸入/輸出
#include <iomanip.h> //參數化輸入/輸出
#include <iostream.h> //數據流輸入/輸出
#include <limits.h> //定義各種數據類型最值常量
#include <locale.h> //定義本地化函數
#include <math.h> //定義數學函數
#include <stdio.h> //定義輸入/輸出函數
#include <stdlib.h> //定義雜項函數及內存分配函數
#include <string.h> //字元串處理
#include <strstrea.h> //基於數組的輸入/輸出
#include <time.h> //定義關於時間的函數
#include <wchar.h> //寬字元處理及輸入/輸出
#include <wctype.h> //寬字元分類
//////////////////////////////////////////////////////////////////////////
標准 C++ (同上的不再注釋)
#include <algorithm> //STL 通用演算法
#include <bitset> //STL 位集容器
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex> //復數類
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque> //STL 雙端隊列容器
#include <exception> //異常處理類
#include <fstream>
#include <functional> //STL 定義運算函數(代替運算符)
#include <limits>
#include <list> //STL 線性列表容器
#include <map> //STL 映射容器
#include <iomanip>
#include <ios> //基本輸入/輸出支持
#include <iosfwd> //輸入/輸出系統使用的前置聲明
#include <iostream>
#include <istream> //基本輸入流
#include <ostream> //基本輸出流
#include <queue> //STL 隊列容器
#include <set> //STL 集合容器
#include <sstream> //基於字元串的流
#include <stack> //STL 堆棧容器
#include <stdexcept> //標准異常類
#include <streambuf> //底層輸入/輸出支持
#include <string> //字元串類
#include <utility> //STL 通用模板類
#include <vector> //STL 動態數組容器
#include <cwchar>
#include <cwctype>
using namespace std;
//////////////////////////////////////////////////////////////////////////
C99 增加
#include <complex.h> //復數處理
#include <fenv.h> //浮點環境
#include <inttypes.h> //整數格式轉換
#include <stdbool.h> //布爾環境
#include <stdint.h> //整型環境
#include <tgmath.h> //通用類型數學宏
#include<conio.h> 說明調用DOS控制台I/O子程序的各個函數。
#include<sio.h> 包含字元串庫函數說明的頭文件
#include<slib.h> 包含動態存儲與釋放函數頭文件。
4. c語言中有哪些頭文件
C/C++頭文件一覽
C、傳統 C++
#include <assert.h> //設定插入點
#include <ctype.h> //字元處理
#include <errno.h> //定義錯誤碼
#include <float.h> //浮點數處理
#include <fstream.h> //文件輸入/輸出
#include <iomanip.h> //參數化輸入/輸出
#include <iostream.h> //數據流輸入/輸出
#include <limits.h> //定義各種數據類型最值常量
#include <locale.h> //定義本地化函數
#include <math.h> //定義數學函數
#include <stdio.h> //定義輸入/輸出函數
#include <stdlib.h> //定義雜項函數及內存分配函數
#include <string.h> //字元串處理
#include <strstrea.h> //基於數組的輸入/輸出
#include <time.h> //定義關於時間的函數
#include <wchar.h> //寬字元處理及輸入/輸出
#include <wctype.h> //寬字元分類
//////////////////////////////////////////////////////////////////////////
標准 C++ (同上的不再注釋)
#include <algorithm> //STL 通用演算法
#include <bitset> //STL 位集容器
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex> //復數類
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque> //STL 雙端隊列容器
#include <exception> //異常處理類
#include <fstream>
#include <functional> //STL 定義運算函數(代替運算符)
#include <limits>
#include <list> //STL 線性列表容器
#include <map> //STL 映射容器
#include <iomanip>
#include <ios> //基本輸入/輸出支持
#include <iosfwd> //輸入/輸出系統使用的前置聲明
#include <iostream>
#include <istream> //基本輸入流
#include <ostream> //基本輸出流
#include <queue> //STL 隊列容器
#include <set> //STL 集合容器
#include <sstream> //基於字元串的流
#include <stack> //STL 堆棧容器
#include <stdexcept> //標准異常類
#include <streambuf> //底層輸入/輸出支持
#include <string> //字元串類
#include <utility> //STL 通用模板類
#include <vector> //STL 動態數組容器
#include <cwchar>
#include <cwctype>
using namespace std;
//////////////////////////////////////////////////////////////////////////
C99 增加
#include <complex.h> //復數處理
#include <fenv.h> //浮點環境
#include <inttypes.h> //整數格式轉換
#include <stdbool.h> //布爾環境
#include <stdint.h> //整型環境
#include <tgmath.h> //通用類型數學宏
#include<conio.h> 說明調用DOS控制台I/O子程序的各個函數。
#include<sio.h> 包含字元串庫函數說明的頭文件
#include<slib.h> 包含動態存儲與釋放函數頭文件
5. C語言中的頭文件有多少種都有哪些C函數庫有哪些
iv_t和lldiv_t;宏例如EXIT_FAILURE、EXIT_SUCCESS、RAND_MAX和MB_CUR_MAX等等;
常見的函數有malloc()、calloc()、realloc()、free()、system()、atoi()、atol()、rand()、srand()、exit()等。具體內容可以在編譯器的包含目錄stdlib.h頭文件中打開查看。
為了方便用戶編寫程序,C語言為用戶開發了大量的庫函數,定義在。H文件,用戶可以調用這些函數來實現強大的功能。因此,對於用戶來說,這些函數的使用是提高編程水平的關鍵。
(5)c語言萬能頭文件有哪些擴展閱讀:
以下內容適用於頭文件
1.對於具有外部存儲類型的標識符,可以在任何其他源程序文件中聲明後引用它們,這樣用戶就可以完全將具有外部存儲類型的標識符的一些聲明放在頭文件中。
2.具體來說,頭文件可以包括用戶構造的數據類型(例如枚舉類型)、外部變數、外部函數、常量和具有一定通用性或公共量的內聯函數。一般的變數和函數定義不應該放在頭文件中。
其他:
雙假設(雙x,雙y);//給定一個直角三角形的兩條邊的長度,求斜邊的長度。
雙ldexp(雙x,int指數);//計算x*(2的指數次方)。
雙poly(Doublex,intdegree,Doublecoeffs[])//計算多項式。
Ntmatherr(structexception*e)//數學錯誤計算處理程序。
6. 單片機c語言中常用的頭文件都有哪些分別有什麼作用啊
reg51.h是專用寄存器文件,8031,8051都為reg它包括8051的SFR及其位定義,一般系統都必須包括這個迴文件。答
absacc.h絕對地址文件。該文件是只定義了幾個宏,以確定各存儲空間的絕對地址。
stdlib.h,動態內存分配函數。
string.h緩沖區處理函數。
stdio.h輸入輸出流函數,流函數通過8051的竄口或者用戶定義的io口來讀取數據,默認為8051竄口.
7. 在windows下用C語言如何實現socket網路編程,需要用到哪些頭文件或者庫
需要用到的頭文件包含:
#include <winsock2.h>
#include <windows.h>
與Linux環境下socket編程相比,windows環境多了一個步驟:啟動或者初始化winsock庫
Winsock,一種標准API,一種網路編程介面,用於兩個或多個應用程序(或進程)之間通過網路進行數據通信。具有兩個版本:
Winsock 1:
Windows CE平台支持。
頭文件:WinSock.h
庫:wsock32.lib
Winsock 2:
部分平台如Windows CE貌似不支持。通過前綴WSA可以區別於Winsock 1版本。個別函數如WSAStartup、WSACleanup、WSARecvEx、WSAGetLastError都屬於Winsock 1.1規范的函數;
頭文件:WinSock2.h
庫:ws2_32.lib
mswsock.h用於編程擴展,使用時必須鏈接mswsock.dll
(7)c語言萬能頭文件有哪些擴展閱讀
winsock庫的載入與卸載:
載入:int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData);
載入成功,返回值為0。
WORD wVersionRequested:載入的winsock版本,使用宏MAKEWORD(x, y),x表示高位元組,y表示低位元組。然而使用時MAKEWORD(2, 2)。高位元組與低位元組相同~~
LPWSADATA lpWSAData:WSADATA結構的指針,傳入參數後,系統幫助我們填充版本信息。有興趣的可以看看結構體內容,不過基本用不著。
卸載:int WSACleanup(void);比起載入,卸載的函數真是輕松愉快。
8. 用C語言實現數據結構時需要哪些頭文件
1、stdio.h,這個是用來輸入輸出。動態內存分配函數要用到的,所以要包含malloc.h,其他的還可能用到字元(串)處理函數(需包含string.h頭文件)、數學函數(需包含math.h),包含什麼頭文件主要看i你想用這些數據結構實現什麼功能,用到什麼函數。
2、C語言常用頭文件:
ALLOC.H 說明內存管理函數(分配、釋放等)。
ASSERT.H 定義 assert調試宏。
BIOS.H 說明調用IBM—PC ROM BIOS子程序的各個函數。
CONIO.H 說明調用DOS控制台I/O子程序的各個函數。
CTYPE.H 包含有關字元分類及轉換的名類信息(如 isalpha和toascii等)。
DIR.H 包含有關目錄和路徑的結構、宏定義和函數。
DOS.H 定義和說明MSDOS和8086調用的一些常量和函數。
ERRON.H 定義錯誤代碼的助記符。
FCNTL.H 定義在與open庫子程序連接時的符號常量。
FLOAT.H 包含有關浮點運算的一些參數和函數。
GRAPHICS.H 說明有關圖形功能的各個函數,圖形錯誤代碼的常量定義,正對不同驅動程序的各種顏色值,及函數用到的一些特殊結構。
IO.H 包含低級I/O子程序的結構和說明。
LIMIT.H 包含各環境參數、編譯時間限制、數的范圍等信息。
MATH.H 說明數學運算函數,還定了 HUGE VAL 宏, 說明了matherr和matherr子程序用到的特殊結構。
MEM.H 說明一些內存操作函數(其中大多數也在STRING.H中說明)。
PROCESS.H 說明進程管理的各個函數,spawn…和EXEC …函數的結構說明。
SETJMP.H 定義longjmp和setjmp函數用到的jmp buf類型,說明這兩個函數。
SHARE.H 定義文件共享函數的參數。
SIGNAL.H 定義SIG[ZZ(Z] [ZZ)]IGN和SIG[ZZ(Z] [ZZ)]DFL常量,說明rajse和signal兩個函數。
STDARG.H 定義讀函數參數表的宏。(如vprintf,vscarf函數)。
STDDEF.H 定義一些公共數據類型和宏。
STDIO.H 定義Kernighan和Ritchie在Unix System V 中定義的標准和擴展的類型和宏。還定義標准I/O 預定義流:stdin,stdout和stderr,說明 I/O流子程序。
STDLIB.H 說明一些常用的子程序:轉換子程序、搜索/ 排序子程序等。
STRING.H 說明一些串操作和內存操作函數。
SYS\STAT.H 定義在打開和創建文件時用到的一些符號常量。
SYS\TYPES.H 說明ftime函數和timeb結構。
SYS\TIME.H 定義時間的類型time[ZZ(Z] [ZZ)]t。
TIME.H 定義時間轉換子程序asctime、localtime和gmtime的結構,ctime、 difftime、 gmtime、 localtime和stime用到的類型,並提供這些函數的原型。
VALUE.H 定義一些重要常量,包括依賴於機器硬體的和為與Unix System V相兼容而說明的一些常量,包括浮點和雙精度值的范圍。