導航:首頁 > 文件類型 > linuxc語言頭文件

linuxc語言頭文件

發布時間:2023-03-01 05:10:47

linux下的c語言的頭文件在windows下頭文件是哪幾個

#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> 包含動態存儲與釋放函數頭文件

② linux下C語言的庫函數的頭文件放在哪個目錄下啊

一般來說是放在來/usr/include目錄下的;

但是這個源並不局限也是可控的,如果我們進行開發過程中, 就會在內核的庫函數文件目錄:

例如在:/XXX/XXX/linux-X.X/include

所以根據不同的情況,頭文件存放的目錄也是不同的,具體需要可以根據locate和grep命令進行查詢。

③ linux c語言如何快速知道函數的頭文件

1、要用到unistd.h頭文件。

2、Write函數用法:write函數所在的頭文件為 <unistd.h>write有兩種用法。一種是:ssize_twrite(int handle, void *buf, int nbyte);handle 是文件描述符;buf是指定的緩沖區,即指針,指向一段內存單元;nbyte是要寫入文件指定的位元組數;返回值:寫入文檔的位元組數(成功);-1(出錯)write函數把buf中nbyte寫入文件描述符handle所指的文檔,成功時返回寫的位元組數,錯誤時返回-1.另一種是:write(const char* str,int n)str是字元指針或字元數組,用來存放一個字元串。n是int型數,它用來表示輸出顯示字元串中字元的個數。write("string",strlen("string");表示輸出字元串常量3、程序示例:

#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<sysstat.h>
#include<io.h>
#include<string.h>
intmain(void)
{
int*handle;charstring[40];
intlength,res;/*Createafilenamed"TEST.$$$".If"TEST.$$$"alreadyexists,itwillbeoverwritten.*/
if((handle=open("TEST.$$$",O_WRONLY|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE))==-1)
{
printf("Erroropeningfile. ");
exit(1);
}
strcpy(string,"Hello,world! ");
length=strlen(string);
if((res=write(handle,string,length))!=length)
{
printf("Errorwritingtothefile. ");
exit(1);
}
printf("Wrote%dbytestothefile. ",res);
close(handle);return0;}

④ Linux下c語言開發怎麼添加頭文件目錄和lib文件目錄

通過編譯選抄項可以設置的襲
Linux下一般用gcc,就以gcc的命令為例
要增加頭文件目錄inc,那麼編譯選項加上-Iinc
如果有多個
就寫多個
比如
-Iinc
-I/home/name/include
類似的
增加lib路徑用-L
比如
-Llib
-Lmy_lib
就是增加當前目錄下
lib和my_lib兩個文件夾作為庫文件目錄。

⑤ Linux下c語言開發怎麼添加頭文件目錄和lib文件目錄

通過編譯抄選項可以設置的
Linux下一般用gcc,就以gcc的命令為例
要增加頭文件目錄inc,那麼編譯選項加上-Iinc
如果有多個 就寫多個
比如 -Iinc -I/home/name/include
類似的 增加lib路徑用-L
比如 -Llib -Lmy_lib
就是增加當前目錄下 lib和my_lib兩個文件夾作為庫文件目錄。

⑥ linux C語言的頭文件對應Windows下的頭文件是哪些

  1. linux和windows平台下,能夠對應的頭文件就是符合C11標準的頭文件。其他的頭文件不僅和平台有關系,還和平台下的編譯環境有關,很難畫上等號的。

  2. 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> //寬字元分類

  3. linux常用頭文件如下:
    POSIX標準定義的頭文件
    <dirent.h> 目錄項
    <fcntl.h> 文件控制
    <fnmatch.h> 文件名匹配類型
    <glob.h> 路徑名模式匹配類型
    <grp.h> 組文件
    <netdb.h> 網路資料庫操作
    <pwd.h> 口令文件
    <regex.h> 正則表達式
    <tar.h> TAR歸檔值
    <termios.h> 終端I/O
    <unistd.h> 符號常量
    <utime.h> 文件時間
    <wordexp.h> 字元擴展類型
    -------------------------
    <arpa/inet.h> INTERNET定義
    <net/if.h> 套接字本地介面
    <netinet/in.h> INTERNET地址族
    <netinet/tcp.h> 傳輸控制協議定義
    -------------------------
    <sys/mman.h> 內存管理聲明
    <sys/select.h> Select函數
    <sys/socket.h> 套接字借口
    <sys/stat.h> 文件狀態
    <sys/times.h> 進程時間
    <sys/types.h> 基本系統數據類型
    <sys/un.h> UNIX域套接字定義
    <sys/utsname.h> 系統名
    <sys/wait.h> 進程式控制制
    ------------------------------
    POSIX定義的XSI擴展頭文件
    <cpio.h> cpio歸檔值
    <dlfcn.h> 動態鏈接
    <fmtmsg.h> 消息顯示結構
    <ftw.h> 文件樹漫遊
    <iconv.h> 代碼集轉換使用程序
    <langinfo.h> 語言信息常量
    <libgen.h> 模式匹配函數定義
    <monetary.h> 貨幣類型
    <ndbm.h> 資料庫操作
    <nl_types.h> 消息類別
    <poll.h> 輪詢函數
    <search.h> 搜索表
    <strings.h> 字元串操作
    <syslog.h> 系統出錯日誌記錄
    <ucontext.h> 用戶上下文
    <ulimit.h> 用戶限制
    <utmpx.h> 用戶帳戶資料庫
    -----------------------------
    <sys/ipc.h> IPC(命名管道)
    <sys/msg.h> 消息隊列
    <sys/resource.h>資源操作
    <sys/sem.h> 信號量
    <sys/shm.h> 共享存儲
    <sys/statvfs.h> 文件系統信息
    <sys/time.h> 時間類型
    <sys/timeb.h> 附加的日期和時間定義
    <sys/uio.h> 矢量I/O操作
    ------------------------------
    POSIX定義的可選頭文件
    <aio.h> 非同步I/O
    <mqueue.h> 消息隊列
    <pthread.h> 線程
    <sched.h> 執行調度
    <semaphore.h> 信號量
    <spawn.h> 實時spawn介面
    <stropts.h> XSI STREAMS介面
    <trace.h> 事件跟蹤

⑦ linux下,C語言頭文件在哪

一、 C標准庫頭文件,以及Linux的標准庫文件的對應頭文件,默認放在/usr/include下。 如圖:

標識出回了最常用的幾答個頭文件。

二、 自定義頭文件,或者集成頭文件,需要在編譯的時候指定。可以在命令行中指定,也可以在makefile中指定。

指定自定義頭文件路徑方式為:

-IPATH1 -IPATH2...

如當前目錄下的inc文件夾,指定為頭文件, 那麼在編譯a.c時,可以命令寫作:

gcc a.c -I./inc -o a.out

⑧ Linux下C編程頭文件

你在mymin.c文件中調用printf函數
前提在你mymin.c文件頭包含了其他的文件而這個文件里有包含stdio.h文件
那你在mymin.c文件里可以不包含stdio.h文件

看了下你文件的編寫
還是不合規范
幫你改下:

/*ex_min.h*/

#ifndef
_ex_min_h

#define
_ex_min_h

#include<stdio.h>

int
min(int
n1,int
n2);

#endif

/*ex_min.c*/

#include
"ex_min.h"

int
min(int
n1,int
n2)

{

printf("調用min\n");

if(n1>n2)

return
n1;

else

return
n2;

}

/*mymin.c*/

#include
"ex_min.h"

int
main()

{

int
n1,n2,n3;

scanf("%d,%d",&n1,&n2);

n3=min(n1,n2);

printf("%d",n3);

}

閱讀全文

與linuxc語言頭文件相關的資料

熱點內容
編程寫東西都寫得是什麼 瀏覽:35
蔚來怎麼推薦app 瀏覽:269
6s輸入密碼來使用siri 瀏覽:742
程序員黑客頭像酷 瀏覽:739
mvc接受上傳文件 瀏覽:365
程序員可以轉金融嗎 瀏覽:193
無需用戶名密碼的共享 瀏覽:775
一加怎麼和win10傳輸文件 瀏覽:425
大數據分析哪些行業 瀏覽:848
win10刪除自動更新文件在哪裡 瀏覽:581
cad打開一個文件要關閉另一文件 瀏覽:432
鋼鐵雄心4升級包 瀏覽:558
一加找不到恢復文件 瀏覽:960
遼寧高中查分數的app有哪些 瀏覽:790
考研復試編程題可以考什麼 瀏覽:118
微信老男人頭像圖片 瀏覽:588
貸款app有哪些東西 瀏覽:74
sim卡突然無網路連接怎麼辦 瀏覽:150
制度文件內容要簡潔 瀏覽:96
java正則表達式一個或多個空格 瀏覽:420

友情鏈接