『壹』 c語言里的庫函數一共有多少個
將浮點數value轉換成字元串並返回該字元串
char
*fcvt(double
value,int
ndigit,int
*decpt,int
*sign)
將浮點數value轉換成字元串並返回該字元串
char
*gcvt(double
value,int
ndigit,char
*buf)
將數value轉換成字元串並存於buf中,並返回buf的指針
char
*ultoa(unsigned
long
value,char
*string,int
radix)
將無符號整型數value轉換成字元串並返回該字元串,radix為轉換時所用基數
char
*ltoa(long
value,char
*string,int
radix)
將長整型數value轉換成字元串並返回該字元串,radix為轉換時所用基數
char
*itoa(int
value,char
*string,int
radix)
將整數value轉換成字元串存入string,radix為轉換時所用基數
double
atof(char
*nptr)
將字元串nptr轉換成雙精度數,並返回這個數,錯誤返回0
int
atoi(char
*nptr)
將字元串nptr轉換成整型數,
並返回這個數,錯誤返回0
long
atol(char
*nptr)
將字元串nptr轉換成長整型數,並返回這個數,錯誤返回0
double
strtod(char
*str,char
**endptr)將字元串str轉換成雙精度數,並返回這個數,
long
strtol(char
*str,char
**endptr,int
base)將字元串str轉換成長整型數,
並返回這個數,
int
matherr(struct
exception
*e)
用戶修改數學錯誤返回信息函數(沒有必要使用)
double
_matherr(_mexcep
why,char
*fun,double
*arg1p,
double
*arg2p,double
retval)
用戶修改數學錯誤返回信息函數(沒有必要使用)
unsigned
int
_clear87()
清除浮點狀態字並返回原來的浮點狀態
void
_fpreset()
重新初使化浮點數學程序包
unsigned
int
_status87()
返回浮點狀態字
int
chdir(char
*path)
使指定的目錄path(如:"C:\\WPS")變成當前的工作目錄,成
功返回0
在turbo
c
2.0中,C語言的庫函數共有353個。
『貳』 哪裡有c語言所有頭文件及其包含函數的列表下載阿
不存在你說的「所有頭文件」,C標准函數庫可以參考
http://herofit.blogspot.com/2006/10/cc-standard-library.html
『叄』 用C語言設計通訊錄要用到庫函數中的哪些函數
"gotoxy()","moveto()"包含在#include <conio.h>中了.
轉載一個程序給你:(ZT)
演算法:將當前時間顯示到屏幕,當時間發生變化時,清屏,顯示新的時間(當有鍵盤操作時退出程序)。
顯示時間格式:小時:分鍾:秒
/* DEV C++ Win XP*/
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
typedef struct
{
int x;
int y;
}Point;
time_t now;
struct tm *pt,t1,t2;
int printpoint(Point p)
{
Point p1;
p1.x=p.x+2; p1.y=p.y+4;
gotoxy(p1.x,p1.y); printf("%c%c",2,2);
gotoxy(p1.x, p1.y+1); printf("%c%c",2,2);
p1.y+=4;
gotoxy(p1.x,p1.y); printf("%c%c",2,2);
gotoxy(p1.x,p1.y+1); printf("%c%c",2,2);
return 0;
}
int print0(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i==0¦¦i==12)
printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else
printf("%c%4s%c",2," ",2);
}
return 0;
}
int print1(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
printf("%5s%c"," ",2);
}
return 0;
}
int print2(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i==0¦¦i==6¦¦i==12)
printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else if(i>0&&i<6)
printf("%5s%c"," ",2);
else
printf("%c",2);
}
return 0;
}
int print3(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i==0¦¦i==6¦¦i==12)
printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else
printf("%5s%c"," ",2);
}
return 0;
}
int print4(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i<6) printf("%c%4s%c",2," ",2);
else if(i==6)
printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else printf("%5s%c"," ",2);
}
return 0;
}
int print5(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i==0¦¦i==6¦¦i==12)
printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else if(i>0&&i<6)
printf("%c",2);
else
printf("%5s%c"," ",2);
}
return 0;
}
int print6(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i==0¦¦i==6¦¦i==12)
printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else if(i>0&&i<6)
printf("%c",2);
else
printf("%c%4s%c",2," ",2);
}
return 0;
}
int print7(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i==0) printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else printf("%5s%c"," ",2);
}
return 0;
}
int print8(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i==0¦¦i==6¦¦i==12)
printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else printf("%c%4s%c",2," ",2);
}
return 0;
}
int print9(Point p)
{
int i=0;
for(;i<13;i++)
{
gotoxy(p.x+1, p.y+i);
if(i==0¦¦i==6¦¦i==12)
printf("%c%c%c%c%c%c",2,2,2,2,2,2);
else if(i>0&&i<6)
printf("%c%4s%c",2," ",2);
else
printf("%5s%c"," ",2);
}
return 0;
}
int clear(Point p)
{
int i=0;
for(;i<13;i++)
gotoxy(p.x,p.y+i); printf("%16s"," ");
return 0;
}
int printtime(Point p, int n)
{
int a,b;
Point pp;
a=n/10, b=n%10;
pp.x=p.x+8, pp.y=p.y;
switch(a)
{
case 0: print0(p); break;
case 1: print1(p); break;
case 2: print2(p); break;
case 3: print3(p); break;
case 4: print4(p); break;
case 5: print5(p); break;
}
switch(b)
{
case 0: print0(pp); break;
case 1: print1(pp); break;
case 2: print2(pp); break;
case 3: print3(pp); break;
case 4: print4(pp); break;
case 5: print5(pp); break;
case 6: print6(pp); break;
case 7: print7(pp); break;
case 8: print8(pp); break;
case 9: print9(pp); break;
}
return 0;
}
int main()
{
Point phour, pmin, psec,point1,point2;
phour.x=9, pmin.x=32, psec.x=55;
phour.y=pmin.y=psec.y=7;
point1.x=25, point2.x=49;
point1.y=point2.y=7;
clrscr();
textbackground(BLUE);
textcolor(YELLOW);
now=time(0);
pt=localtime(&now);
t1=*pt;
printtime(phour, t1.tm_hour);
printpoint(point1);
printtime(pmin, t1.tm_min);
printpoint(point2);
printtime(psec, t1.tm_sec);
while(1)
{
now=time(0);
pt=localtime(&now);
t2=*pt;
if(t2.tm_sec!=t1.tm_sec)
{
t1=t2;
clrscr();
printtime(phour, t1.tm_hour);
printpoint(point1);
printtime(pmin, t1.tm_min);
printpoint(point2);
printtime(psec, t1.tm_sec);
}
if(bioskey(1)==0) continue;
else exit(0);
}
return 0;
}
參考文獻:FROM do熊
『肆』 C語言中參數列表寫在函數名後面的_______內
小括弧
ps:逗號分割。如果是函數申明,可以省略參數名,保留參數類型。
『伍』 C語言庫函數里有線性表基本操作函數嗎
在實際應用中,線性表都是以棧、隊列、字元串、數組等特殊線性表的形式來使用的。
C語言標准庫沒有線性表的操作
但是C++ STL提供了很多函數/數據結構
『陸』 linux中c語言庫函數目錄
樓上已經講的很好了, 我再給你普及一下。
內核的memset函數是內核自己用的。 你在用戶層面是看不見這個memset的。
內核所有的函數都是自己內部實現的, 沒有使用別的庫。
你寫應用程序的時候用的memset一般是由glibc提供的,
最起碼弄清楚一點, 內核不使用其他的C庫, 完全自給自足。 你平時用的C庫函數在內核是找不到的
樓上已經講的很好了, 我在給你普及一下。
內核的memset函數是內核自己用的。 你在用戶層面是看不見這個memset的。
內核所有的函數都是自己內部實現的, 沒有使用別的庫。
你寫應用程序的時候用的memset一般是由glibc提供的,
最起碼弄清楚一點, 內核不使用其他的C庫, 完全自給自足。 你平時用的C庫函數在內核是找不到的
還有內核源碼不光是PC上用的, 其他架構的源碼也提供, arch 文件夾下面就是與架構相關的代碼
PC一般是x86
『柒』 C語言中有什麼關於介紹所有庫函數的書嗎
c語言庫函數大全: int isalpha(int ch) 若ch是字母('A'-'Z','a'-'z')返回非0值,否則返回0 int isalnum(int ch) 若ch是字母('A'-'Z','a'-'z')或數字('0'-'9') 返回非0值,否則返回0 int isascii(int ch) 若ch是字元(ASCII碼中的0-127)返回非0值,否則返回0 int iscntrl(int ch) 若ch是作廢字元(0x7F)或普通控制字元(0x00-0x1F) 返回非0值,否則返回0 int isdigit(int ch) 若ch是數字('0'-'9')返回非0值,否則返回0 int isgraph(int ch) 若ch是可列印字元(不含空格)(0x21-0x7E)返回非0值,否則返回0 int islower(int ch) 若ch是小寫字母('a'-'z')返回非0值,否則返回0 int isprint(int ch) 若ch是可列印字元(含空格)(0x20-0x7E)返回非0值,否則返回0 int ispunct(int ch) 若ch是標點字元(0x00-0x1F)返回非0值,否則返回0 int isspace(int ch) 若ch是空格(' '),水平製表符('\t'),回車符('\r'), 走紙換行('\f'),垂直製表符('\v'),換行符('\n') 返回非0值,否則返回0 int isupper(int ch) 若ch是大寫字母('A'-'Z')返回非0值,否則返回0 int isxdigit(int ch) 若ch是16進制數('0'-'9','A'-'F','a'-'f')返回非0值, 否則返回0 int tolower(int ch) 若ch是大寫字母('A'-'Z')返回相應的小寫字母('a'-'z') int toupper(int ch) 若ch是小寫字母('a'-'z')返回相應的大寫字母('A'-'Z') ========數學函數(原型聲明所在頭文件為math.h、stdlib.h、string.h、float.h)=========== int abs(int i) 返回整型參數i的絕對值 double cabs(struct complex znum) 返回復數znum的絕對值 double fabs(double x) 返回雙精度參數x的絕對值 long labs(long n) 返回長整型參數n的絕對值 double exp(double x) 返回指數函數ex的值 double frexp(double value,int *eptr) 返回value=x*2n中x的值,n存貯在eptr中 double ldexp(double value,int exp); 返回value*2exp的值 double log(double x) 返回logex的值 double log10(double x) 返回log10x的值 double pow(double x,double y) 返回xy的值 double pow10(int p) 返回10p的值 double sqrt(double x) 返回x的開方 double acos(double x) 返回x的反餘弦cos-1(x)值,x為弧度 double asin(double x) 返回x的反正弦sin-1(x)值,x為弧度 double atan(double x) 返回x的反正切tan-1(x)值,x為弧度 double atan2(double y,double x) 返回y/x的反正切tan-1(x)值,y的x為弧度 double cos(double x) 返回x的餘弦cos(x)值,x為弧度 double sin(double x) 返回x的正弦sin(x)值,x為弧度 double tan(double x) 返回x的正切tan(x)值,x為弧度 double cosh(double x) 返回x的雙曲餘弦cosh(x)值,x為弧度 double sinh(double x) 返回x的雙曲正弦sinh(x)值,x為弧度 double tanh(double x) 返回x的雙曲正切tanh(x)值,x為弧度 double hypot(double x,double y) 返回直角三角形斜邊的長度(z), x和y為直角邊的長度,z2=x2+y2 double ceil(double x) 返回不小於x的最小整數 double floor(double x) 返回不大於x的最大整數 void srand(unsigned seed) 初始化隨機數發生器 int rand() 產生一個隨機數並返回這個數 double poly(double x,int n,double c[])從參數產生一個多項式 double modf(double value,double *iptr)將雙精度數value分解成尾數和階 double fmod(double x,double y) 返回x/y的余數 double frexp(double value,int *eptr) 將雙精度數value分成尾數和階 double atof(char *nptr) 將字元串nptr轉換成浮點數並返回這個浮點數 double atoi(char *nptr) 將字元串nptr轉換成整數並返回這個整數 double atol(char *nptr) 將字元串nptr轉換成長整數並返回這個整數 char *ecvt(double value,int ndigit,int *decpt,int *sign) 將浮點數value轉換成字元串並返回該字元串 char *fcvt(double value,int ndigit,int *decpt,int *sign) 將浮點數value轉換成字元串並返回該字元串 char *gcvt(double value,int ndigit,char *buf) 將數value轉換成字元串並存於buf中,並返回buf的指針 char *ultoa(unsigned long value,char *string,int radix) 將無符號整型數value轉換成字元串並返回該字元串,radix為轉換時所用基數 char *ltoa(long value,char *string,int radix) 將長整型數value轉換成字元串並返回該字元串,radix為轉換時所用基數 char *itoa(int value,char *string,int radix) 將整數value轉換成字元串存入string,radix為轉換時所用基數 double atof(char *nptr) 將字元串nptr轉換成雙精度數,並返回這個數,錯誤返回0 int atoi(char *nptr) 將字元串nptr轉換成整型數, 並返回這個數,錯誤返回0 long atol(char *nptr) 將字元串nptr轉換成長整型數,並返回這個數,錯誤返回0 double strtod(char *str,char **endptr)將字元串str轉換成雙精度數,並返回這個數, long strtol(char *str,char **endptr,int base)將字元串str轉換成長整型數, 並返回這個數, int matherr(struct exception *e) 用戶修改數學錯誤返回信息函數(沒有必要使用) double _matherr(_mexcep why,char *fun,double *arg1p, double *arg2p,double retval) 用戶修改數學錯誤返回信息函數(沒有必要使用) unsigned int _clear87() 清除浮點狀態字並返回原來的浮點狀態 void _fpreset() 重新初使化浮點數學程序包 unsigned int _status87() 返回浮點狀態字 ============目錄函數(原型聲明所在頭文件為dir.h、dos.h)================ int chdir(char *path) 使指定的目錄path(如:"C:\\WPS")變成當前的工作目錄,成 功返回0 int findfirst(char *pathname,struct ffblk *ffblk,int attrib)查找指定的文件,成功 返回0 pathname為指定的目錄名和文件名,如"C:\\WPS\\TXT" ffblk為指定的保存文件信息的一個結構,定義如下: ┏━━━━━━━━━━━━━━━━━━┓ ┃struct ffblk ┃ ┃{ ┃ ┃ char ff_reserved[21]; /*DOS保留字*/┃ ┃ char ff_attrib; /*文件屬性*/ ┃ ┃ int ff_ftime; /*文件時間*/ ┃ ┃ int ff_fdate; /*文件日期*/ ┃ ┃ long ff_fsize; /*文件長度*/ ┃ ┃ char ff_name[13]; /*文件名*/ ┃ ┃} ┃ ┗━━━━━━━━━━━━━━━━━━┛ attrib為文件屬性,由以下字元代表 ┏━━━━━━━━━┳━━━━━━━━┓ ┃FA_RDONLY 只讀文件┃FA_LABEL 卷標號┃ ┃FA_HIDDEN 隱藏文件┃FA_DIREC 目錄 ┃ ┃FA_SYSTEM 系統文件┃FA_ARCH 檔案 ┃ ┗━━━━━━━━━┻━━━━━━━━┛ 例: struct ffblk ff; findfirst("*.wps",&ff,FA_RDONLY); int findnext(struct ffblk *ffblk) 取匹配finddirst的文件,成功返回0 void fumerge(char *path,char *drive,char *dir,char *name,char *ext) 此函數通過盤符drive(C:、A:等),路徑dir(\TC、\BC\LIB等), 文件名name(TC、WPS等),擴展名ext(.EXE、.COM等)組成一個文件名 存與path中. int fnsplit(char *path,char *drive,char *dir,char *name,char *ext) 此函數將文件名path分解成盤符drive(C:、A:等),路徑dir(\TC、\BC\LIB等), 文件名name(TC、WPS等),擴展名ext(.EXE、.COM等),並分別存入相應的變數中. int getcurdir(int drive,char *direc) 此函數返回指定驅動器的當前工作目錄名稱 drive 指定的驅動器(0=當前,1=A,2=B,3=C等) direc 保存指定驅動器當前工作路徑的變數 成功返回0 char *getcwd(char *buf,iint n) 此函數取當前工作目錄並存入buf中,直到n個字 節長為為止.錯誤返回NULL int getdisk() 取當前正在使用的驅動器,返回一個整數(0=A,1=B,2=C等) int setdisk(int drive) 設置要使用的驅動器drive(0=A,1=B,2=C等), 返回可使用驅動器總數 int mkdir(char *pathname) 建立一個新的目錄pathname,成功返回0 int rmdir(char *pathname) 刪除一個目錄pathname,成功返回0 char *mktemp(char *template) 構造一個當前目錄上沒有的文件名並存於template中 char *searchpath(char *pathname) 利用MSDOS找出文件filename所在路徑, ,此函數使用DOS的PATH變數,未找到文件返回NULL ===========進程函數(原型聲明所在頭文件為stdlib.h、process.h)=========== void abort() 此函數通過調用具有出口代碼3的_exit寫一個終止信息於stderr, 並異常終止程序。無返回值 int exec…裝入和運行其它程序 int execl( char *pathname,char *arg0,char *arg1,…,char *argn,NULL) int execle( char *pathname,char *arg0,char *arg1,…, char *argn,NULL,char *envp[]) int execlp( char *pathname,char *arg0,char *arg1,…,NULL) int execlpe(char *pathname,char *arg0,char *arg1,…,NULL,char *envp[]) int execv( char *pathname,char *argv[]) int execve( char *pathname,char *argv[],char *envp[]) int execvp( char *pathname,char *argv[]) int execvpe(char *pathname,char *argv[],char *envp[]) exec函數族裝入並運行程序pathname,並將參數 arg0(arg1,arg2,argv[],envp[])傳遞給子程序,出錯返回-1 在exec函數族中,後綴l、v、p、e添加到exec後, 所指定的函數將具有某種操作能力 有後綴 p時,函數可以利用DOS的PATH變數查找子程序文件。 l時,函數中被傳遞的參數個數固定。 v時,函數中被傳遞的參數個數不固定。 e時,函數傳遞指定參數envp,允許改變子進程的環境, 無後綴e時,子進程使用當前程序的環境。 void _exit(int status)終止當前程序,但不清理現場 void exit(int status) 終止當前程序,關閉所有文件,寫緩沖區的輸出(等待輸出), 並調用任何寄存器的"出口函數",無返回值 int spawn…運行子程序 int spawnl( int mode,char *pathname,char *arg0,char *arg1,…, char *argn,NULL) int spawnle( int mode,char *pathname,char *arg0,char *arg1,…, char *argn,NULL,char *envp[]) int spawnlp( int mode,char *pathname,char *arg0,char *arg1,…, char *argn,NULL) int spawnlpe(int mode,char *pathname,char *arg0,char *arg1,…, char *argn,NULL,char *envp[]) int spawnv( int mode,char *pathname,char *argv[]) int spawnve( int mode,char *pathname,char *argv[],char *envp[]) int spawnvp( int mode,char *pathname,char *argv[]) int spawnvpe(int mode,char *pathname,char *argv[],char *envp[]) spawn函數族在mode模式下運行子程序pathname,並將參數 arg0(arg1,arg2,argv[],envp[])傳遞給子程序.出錯返回-1 mode為運行模式 mode為 P_WAIT 表示在子程序運行完後返回本程序 P_NOWAIT 表示在子程序運行時同時運行本程序(不可用) P_OVERLAY表示在本程序退出後運行子程序 在spawn函數族中,後綴l、v、p、e添加到spawn後, 所指定的函數將具有某種操作能力 有後綴 p時, 函數利用DOS的PATH查找子程序文件 l時, 函數傳遞的參數個數固定. v時, 函數傳遞的參數個數不固定. e時, 指定參數envp可以傳遞給子程序,允許改變子程序運行環境. 當無後綴e時,子程序使用本程序的環境. int system(char *command) 將MSDOS命令command傳遞給DOS執行 ======轉換子程序(函數原型所在頭文件為math.h、stdlib.h、ctype.h、float.h)======== char *ecvt(double value,int ndigit,int *decpt,int *sign) 將浮點數value轉換成字元串並返回該字元串 char *fcvt(double value,int ndigit,int *decpt,int *sign) 將浮點數value轉換成字元串並返回該字元串 char *gcvt(double value,int ndigit,char *buf) 將數value轉換成字元串並存於buf中,並返回buf的指針 char *ultoa(unsigned long value,char *string,int radix) 將無符號整型數value轉換成字元串並返回該字元串,radix為轉換時所用基數 char *ltoa(long value,char *string,int radix) 將長整型數value轉換成字元串並返回該字元串,radix為轉換時所用基數 char *itoa(int value,char *string,int radix) 將整數value轉換成字元串存入string,radix為轉換時所用基數 double atof(char *nptr) 將字元串nptr轉換成雙精度數,並返回這個數,錯誤返回0 int atoi(char *nptr) 將字元串nptr轉換成整型數, 並返回這個數,錯誤返回0 long atol(char *nptr) 將字元串nptr轉換成長整型數,並返回這個數,錯誤返回0 double strtod(char *str,char **endptr)將字元串str轉換成雙精度數,並返回這個數, long strtol(char *str,char **endptr,int base)將字元串str轉換成長整型數, 並返回這個數, int toascii(int c) 返回c相應的ASCII int tolower(int ch) 若ch是大寫字母('A'-'Z')返回相應的小寫字母('a'-'z') int _tolower(int ch) 返回ch相應的小寫字母('a'-'z') int toupper(int ch) 若ch是小寫字母('a'-'z')返回相應的大寫字母('A'-'Z') int _toupper(int ch) 返回ch相應的大寫字母('A'-'Z')
『捌』 c語言常用庫函數有哪些
C語言的標准庫函數有數百個,分布在不同的庫文件中,目前絕大多數系統和程序肯定兼容的是C99標准,但2011年已經發布了更新的版本,有些遺留系統不一定支持最新的特性。
不同函數應用場合不一樣,說不說哪些更常用,就看你所做工作的性質了。
通常來說,至少在基礎編程時,stdio中的輸入輸出(可能是控制台的、也可能是文件的)、stdlib中的各種通用工具(如分配堆內存)、string中的字元串處理、time中的日期時間處理、math中的數學函數都算是比較常用的。
『玖』 誰有C語言的所有庫函數原形列表
網頁鏈接
支持中文。