C语言函数大全
C语言函数大全

C语言函数大全C语言作为一种广泛应用的计算机编程语言,其函数是程序设计中不可或缺的部分。
C语言函数大全涵盖了C语言中常用的各种函数,包括数学函数、字符串函数、输入输出函数等,本文将对这些函数进行详细介绍。
一、数学函数。
1. abs函数。
abs函数用于返回一个整数的绝对值,其原型为int abs(int x)。
2. pow函数。
pow函数用于计算一个数的幂,其原型为double pow(double x, double y)。
3. sqrt函数。
sqrt函数用于计算一个数的平方根,其原型为double sqrt(double x)。
4. sin函数。
sin函数用于计算一个角度的正弦值,其原型为double sin(double x)。
5. cos函数。
cos函数用于计算一个角度的余弦值,其原型为double cos(double x)。
6. tan函数。
tan函数用于计算一个角度的正切值,其原型为double tan(double x)。
二、字符串函数。
1. strlen函数。
strlen函数用于返回一个字符串的长度,其原型为size_t strlen(const char s)。
2. strcpy函数。
strcpy函数用于将一个字符串复制到另一个字符串中,其原型为charstrcpy(char dest, const char src)。
3. strcat函数。
strcat函数用于将一个字符串追加到另一个字符串的末尾,其原型为char strcat(char dest, const char src)。
4. strcmp函数。
strcmp函数用于比较两个字符串,其原型为int strcmp(const char s1, const char s2)。
5. strchr函数。
strchr函数用于在一个字符串中查找指定字符的位置,其原型为charstrchr(const char s, int c)。
c语言常用函数大全

c语言常用函数大全1.int iscntrl(int c) 判断字符c是否为控制字符。
2.int isalnum(int c) 判断字符c是否为字母或数字3.int isalpha(int c) 判断字符c是否为英文字母4.int isascii(int c) 判断字符c是否为ascii码5.int isblank(int c) 判断字符c是否为TAB或空格6.int isdigit(int c) 判断字符c是否为数字7.int isgraph(int c) 判断字符c是否为除空格外的可打印字符8.int islower(int c) 判断字符c是否为小写英文字母9.int isprint(int c) 判断字符c是否为可打印字符(含空格)10.int ispunct(int c) 判断字符c是否为标点符号11.int isspace(int c) 判断字符c是否为空白符12.int isupper(int c) 判断字符c是否为大写英文字母13.int isxdigit(int c) 判断字符c是否为十六进制数字14.int toascii(int c) 将字符c转换为ascii码15.int tolower(int c) 将字符c转换为小写英文字母16.int toupper(int c); 将字符c转换为大写英文字母17.float fabs(float x) 求浮点数x的绝对值18.int abs(int x) 求整数x的绝对值19.float acos(float x) 求x(弧度表示)的反余弦值20.float asin(float x) 求x(弧度表示)的反正弦值21.float atan(float x) 求x(弧度表示)的反正切值22.float atan2(float y, float x) 求y/x(弧度表示)的反正切值23.float ceil(float x) 求不小于x的最小整数24.float cos(float x) 求x(弧度表示)的余弦值25.float cosh(float x) 求x的双曲余弦值26.float exp(float x) 求e的x次幂。
c语言常用函数大全及详解

C语言常用函数包括:1.printf函数:用于在控制台输出数据。
2.scanf函数:用于从控制台读取用户输入的数据。
3.strlen函数:用于计算字符串的长度。
4.strcmp函数:用于比较两个字符串的大小。
5.strcpy函数:用于将一个字符串复制到另一个字符串中。
6.strcat函数:用于将一个字符串连接到另一个字符串的末尾。
7.strchr函数:用于查找字符串中指定字符的位置。
8.strstr函数:用于查找字符串中指定子串的位置。
9.atoi函数:用于将字符串转换为整数。
10.atof函数:用于将字符串转换为浮点数。
11.malloc函数:用于动态分配内存空间。
12.free函数:用于释放动态分配的内存空间。
13.memcpy函数:用于将一段内存区域的数据复制到另一段内存区域。
14.memset函数:用于将一段内存区域的数据设置为指定的值。
15.abs函数:用于计算整数的绝对值。
16.rand函数:用于生成随机数。
17.srand函数:用于设置随机数生成器的种子。
18.time函数:用于获取当前的系统时间。
19.localtime函数:用于将时间戳转换为本地时间。
20.strtol函数:用于将字符串转换为长整型数。
21.strtod函数:用于将字符串转换为双精度浮点数。
22.fprintf函数:用于将数据格式化输出到文件中。
23.fscanf函数:用于从文件中读取格式化的数据。
24.fgets函数:用于从文件中读取一行数据。
25.fputs函数:用于将数据写入文件中。
26.fopen函数:用于打开文件。
27.fclose函数:用于关闭文件。
28.feof函数:用于判断文件是否已经到达文件末尾。
29.ferror函数:用于判断文件操作是否发生错误。
30.fprintf函数:用于将数据格式化输出到文件中。
C语言中常见功能函数

C语言中常见功能函数在C语言中,有很多常见的功能函数,它们是为了方便程序员在开发过程中进行一些常见操作而设计的。
下面是其中一些常见的功能函数:1.字符串操作函数:- strlen:用于获取字符串的长度。
- strcpy:用于复制字符串。
- strcat:用于拼接两个字符串。
- strcmp:用于比较两个字符串。
- strchr:用于在字符串中查找指定字符。
- strstr:用于在字符串中查找指定子字符串。
2.内存操作函数:- malloc:用于动态分配内存。
- free:用于释放动态分配的内存。
- memcpy:用于内存拷贝。
- memset:用于内存初始化。
3.文件操作函数:- fopen:用于打开文件。
- fclose:用于关闭文件。
- fgets:用于从文件中读取一行数据。
- fputs:用于向文件中写入一行数据。
- feof:用于判断是否到达文件末尾。
4.数学函数:- abs:用于计算绝对值。
- sin、cos、tan:用于计算三角函数值。
- sqrt:用于计算平方根。
- pow:用于计算幂运算。
5.随机数函数:- srand:用于设置随机数种子。
- rand:用于生成随机数。
6.时间函数:7.输入输出函数:- printf:用于向标准输出设备打印输出。
- scanf:用于从标准输入设备读取输入。
8.排序和查找函数:- qsort:用于对数组进行快速排序。
- bsearch:用于在有序数组中进行二分查找。
9.环境变量函数:- getenv:用于获取环境变量的值。
- setenv:用于设置环境变量的值。
10.字符处理函数:- isdigit:用于判断字符是否是数字。
- isalpha:用于判断字符是否是字母。
- isspace:用于判断字符是否是空白字符。
以上只是C语言中常见的一些功能函数,实际上C语言库中还有很多其他功能函数,可以根据需求选择合适的函数来完成相应的操作。
无论是字符串操作、内存操作、文件操作、数学运算,还是随机数生成、时间处理、输入输出以及排序和查找等,C语言提供了丰富的函数库来支持这些常见的功能需求。
c语言常用函数大全及详解

c语言常用函数大全及详解C语言是一种通用的、面向过程的编程语言,被广泛应用于系统软件、嵌入式开发以及科学计算领域。
在C语言中,函数是一种模块化编程的基本方法,通过函数可以将一段代码进行封装和复用,提高了代码的可读性和可维护性。
本文将介绍一些C语言中常用的函数,并详细解释其用法及重要参数。
一、数学函数1. abs()函数函数原型:int abs(int x);函数功能:返回x的绝对值。
参数说明:x为一个整数。
2. pow()函数函数原型:double pow(double x, double y);函数功能:计算x的y次方。
参数说明:x和y为两个double类型的实数。
3. sqrt()函数函数原型:double sqrt(double x);函数功能:计算x的平方根。
参数说明:x为一个double类型的实数。
二、字符串函数1. strcpy()函数函数原型:char* strcpy(char* destination, const char* source);函数功能:将source字符串复制到destination字符串。
参数说明:destination为目标字符串,source为源字符串。
2. strlen()函数函数原型:size_t strlen(const char* str);函数功能:计算str字符串的长度。
参数说明:str为一个以'\0'结尾的字符串。
3. strcat()函数函数原型:char* strcat(char* destination, const char* source);函数功能:将source字符串拼接到destination字符串的末尾。
参数说明:destination为目标字符串,source为源字符串。
三、文件操作函数1. fopen()函数函数原型:FILE* fopen(const char* filename, const char* mode);函数功能:打开一个文件,并返回文件指针。
C语言库函数大全

C语言库函数大全absread()读磁盘绝对扇区函数原形:int absread(int drive,int num,int sectnum,void *buf)功能:从drive指定的驱动器磁盘上,sectnum指定的逻辑扇区号开始读取(通过DOS中断0x25读取)num个(最多64K个)扇区的内容,储存于buf所指的缓冲区中。
参数:drive=0对应A盘,drive=1对应B盘。
返回值:0:成功;-1:失败。
头文件:dos.habswrite()写磁盘绝对扇区函数原形:int abswrite(int drive,int nsects,int lsect,void *buffer)drive=0(A驱动器)、1(B驱动器)、nsects=要写的扇区数(最多64K个);lsect=起始逻辑扇区号;buffer=要写入数据的内存起始地址。
功能:将指定内容写入(调用DOS中断0x26)磁盘上的指定扇区,即使写入的地方是磁盘的逻辑结构、文件、FAT表和目录结构所在的扇区,也照常进行。
返回值:0:成功;-1:失败。
头文件:dos.hatof()将字符串转换成浮点数的函数原形:double atof(const char *s)功能:把s所指向的字符串转换成double类型。
s格式为:符号数字.数字 E符号数字返回值:字符串的转换值。
头文件:math.h、stdlib.hatoi()将字符串转换成整型数的函数原形:int atoi(const char *s)功能:把s所指向的字符串转换成int类型。
s格式为:符号数字返回值:字符串的转换值。
若出错则返回0。
头文件:stdlib.hatol()将字符串转换成长整型数的函数原形:long atol(const char *s)功能:把s所指向的字符串转换成long int类型。
s格式为:符号数字返回值:字符串的转换值。
若出错则返回0。
头文件:stdlib.hbcd()把一个数转换成对应的BCD码的函数原形:bcd bcd(int x)bcd bcd(double x)bcd bcd(double x,int decimals)注意:BCD码的精度可达17位。
C语言文件操作函数大全

C语言文件操作函数大全1. `fopen`:打开文件```FILE* fopen(const char* filename, const char* mode);```该函数用于打开一个文件,成功打开返回文件指针,打开失败返回`NULL`。
`filename` 是要打开的文件名,`mode` 是打开模式,常用的模式有 "r"(只读)、"w"(可写,若文件不存在则创建新文件)、"a"(追加模式)。
2. `fclose`:关闭文件```int fclose(FILE* stream);```该函数用于关闭一个文件,成功关闭返回0,关闭失败返回 `EOF`。
`stream` 是要关闭的文件指针。
3. `fread`:读取文件内容```size_t fread(void* ptr, size_t size, size_t count, FILE* stream);```该函数从文件中读取内容,存储到指定的内存块。
`ptr` 是指向要读取数据的内存块的指针,`size` 是每个数据项的大小,`count` 是要读取的数据项数目。
4. `fwrite`:写入文件内容```size_t fwrite(const void* ptr, size_t size, size_t count, FILE* stream);```该函数将指定的内存块内容写入文件。
`ptr` 是指向要写入数据的内存块的指针,`size` 是每个数据项的大小,`count` 是要写入的数据项数目。
5. `fgetc`:读取一个字符```int fgetc(FILE* stream);```该函数从文件中读取一个字符,成功读取返回字符对应的整数值,读取失败或到达文件末尾返回`EOF`。
6. `fputc`:写入一个字符```int fputc(int c, FILE* stream);```该函数将一个字符写入文件,成功写入返回写入的字符,写入失败返回`EOF`。
C语言函数大全-c开头-完整版

C语言函数大全(c开头)函数名: cabs功能: 计算复数的绝对值用法: double cabs(struct complex z);程序例:#include#includeint main(void){struct complex z;double val;z.x = 2.0;z.y = 1.0;val = cabs(z);printf("The absolute value of %.2lfi %.2lfj is %.2lf", z.x, z.y, val); return 0;}函数名: calloc功能: 分配主存储器用法: void *calloc(size_t nelem, size_t elsize);程序例:#include#includeint main(void){char *str = NULL;/* allocate memory for string */str = calloc(10, sizeof(char));/* copy "Hello" into string */strcpy(str, "Hello");/* display string */printf("String is %s\n", str);/* free memory */free(str);return 0;}函数名: ceil功能: 向上舍入用法: double ceil(double x);程序例:#include#includeint main(void){double number = 123.54;double down, up;down = floor(number);up = ceil(number);printf("original number %5.2lf\n", number);printf("number rounded down %5.2lf\n", down);printf("number rounded up %5.2lf\n", up);return 0;}函数名: cgets功能: 从控制台读字符串用法: char *cgets(char *str);程序例:#include#includeint main(void){char buffer[83];char *p;/* There's space for 80 characters plus the NULL terminator */ buffer[0] = 81;printf("Input some chars:");p = cgets(buffer);printf("\ncgets read %d characters: \"%s\"\n", buffer[1], p);printf("The returned pointer is %p, buffer[0] is at %p\n", p, &buffer);/* Leave room for 5 characters plus the NULL terminator */buffer[0] = 6;printf("Input some chars:");p = cgets(buffer);printf("\ncgets read %d characters: \"%s\"\n", buffer[1], p);printf("The returned pointer is %p, buffer[0] is at %p\n", p, &buffer); return 0;}函数名: chdir功能: 改变工作目录用法: int chdir(const char *path);程序例:#include#include#includechar old_dir[MAXDIR];char new_dir[MAXDIR];int main(void){if (getcurdir(0, old_dir)){perror("getcurdir()");exit(1);}printf("Current directory is: \\%s\n", old_dir);if (chdir("\\")){perror("chdir()");exit(1);}if (getcurdir(0, new_dir)){perror("getcurdir()");exit(1);}printf("Current directory is now: \\%s\n", new_dir);printf("\nChanging back to orignal directory: \\%s\n", old_dir);if (chdir(old_dir)){perror("chdir()");exit(1);}return 0;}函数名: _chmod, chmod功能: 改变文件的访问方式用法: int chmod(const char *filename, int permiss); 程序例:#include#include#includevoid make_read_only(char *filename);int main(void){make_read_only("NOTEXIST.FIL");make_read_only("MYFILE.FIL");return 0;}void make_read_only(char *filename){int stat;stat = chmod(filename, S_IREAD);if (stat)printf("Couldn't make %s read-only\n", filename); elseprintf("Made %s read-only\n", filename);}函数名: chsize功能: 改变文件大小用法: int chsize(int handle, long size);程序例:#include#include#includeint main(void){int handle;char buf[11] = "0123456789";/* create text file containing 10 bytes */handle = open("DUMMY.FIL", O_CREAT);write(handle, buf, strlen(buf));/* truncate the file to 5 bytes in size */chsize(handle, 5);/* close the file */close(handle);return 0;}函数名: circle功能: 在给定半径以(x, y)为圆心画圆用法: void far circle(int x, int y, int radius);程序例:#include#include#include#includeint main(void){/* request auto detection */int gdriver = DETECT, gmode, errorcode;int midx, midy;int radius = 100;/* initialize graphics and local variables */initgraph(&gdriver, &gmode, "");/* read result of initialization */errorcode = graphresult();if (errorcode != grOk) /* an error occurred */{printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:");getch();exit(1); /* terminate with an error code */}midx = getmaxx() / 2;midy = getmaxy() / 2;setcolor(getmaxcolor());circle(midx, midy, radius);/* clean up */getch();closegraph();return 0;}函数名: cleardevice功能: 清除图形屏幕用法: void far cleardevice(void);程序例:#include#include#include#includeint main(void){/* request auto detection */int gdriver = DETECT, gmode, errorcode;int midx, midy;/* initialize graphics and local variables */initgraph(&gdriver, &gmode, "");/* read result of initialization */errorcode = graphresult();if (errorcode != grOk) /* an error occurred */{printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:");getch();exit(1); /* terminate with an error code */}midx = getmaxx() / 2;midy = getmaxy() / 2;setcolor(getmaxcolor());/* for centering screen messages */settextjustify(CENTER_TEXT, CENTER_TEXT);/* output a message to the screen */outtextxy(midx, midy, "press any key to clear the screen:"); /* wait for a key */getch();cleardevice();/* output another message */outtextxy(midx, midy, "press any key to quit:");/* clean up */getch();closegraph();return 0;}函数名: clearerr功能: 复位错误标志用法:void clearerr(FILE *stream);程序例:#includeint main(void){FILE *fp;char ch;/* open a file for writing */fp = fopen("DUMMY.FIL", "w");/* force an error condition by attempting to read */ ch = fgetc(fp);printf("%c\n",ch);if (ferror(fp)){/* display an error message */printf("Error reading from DUMMY.FIL\n");/* reset the error and EOF indicators */clearerr(fp);}fclose(fp);return 0;}函数名: clearviewport功能: 清除图形视区用法: void far clearviewport(void);程序例:#include#include#include#include#define CLIP_ON 1 /* activates clipping in viewport */int main(void){/* request auto detection */int gdriver = DETECT, gmode, errorcode;int ht;/* initialize graphics and local variables */initgraph(&gdriver, &gmode, "");/* read result of initialization */errorcode = graphresult();if (errorcode != grOk) /* an error occurred */{printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:");getch();exit(1); /* terminate with an error code */}setcolor(getmaxcolor());ht = textheight("W");/* message in default full-screen viewport */outtextxy(0, 0, "* <-- (0, 0) in default viewport");/* create a smaller viewport */setviewport(50, 50, getmaxx()-50, getmaxy()-50, CLIP_ON); /* display some messages */outtextxy(0, 0, "* <-- (0, 0) in smaller viewport"); outtextxy(0, 2*ht, "Press any key to clear viewport:");/* wait for a key */getch();/* clear the viewport */clearviewport();/* output another message */outtextxy(0, 0, "Press any key to quit:");/* clean up */getch();closegraph();return 0;}函数名: _close, close功能: 关闭文件句柄用法: int close(int handle);程序例:#include#include#include#includemain(){int handle;char buf[11] = "0123456789";/* create a file containing 10 bytes */ handle = open("NEW.FIL", O_CREAT); if (handle > -1){write(handle, buf, strlen(buf));/* close the file */close(handle);}else{printf("Error opening file\n");}return 0;}函数名: clock功能: 确定处理器时间用法: clock_t clock(void);QQ291911320程序例:#include#include#includeint main(void){clock_t start, end;start = clock();delay(2000);end = clock();printf("The time was: %f\n", (end - start) / CLK_TCK); return 0;}函数名: closegraph功能: 关闭图形系统用法: void far closegraph(void);程序例:#include#include#include#includeint main(void){/* request auto detection */int gdriver = DETECT, gmode, errorcode;int x, y;/* initialize graphics mode */initgraph(&gdriver, &gmode, "");/* read result of initialization */errorcode = graphresult();if (errorcode != grOk) /* an erroroccurred */{printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:");getch();exit(1); /* terminate with an error code */}x = getmaxx() / 2;y = getmaxy() / 2;/* output a message */settextjustify(CENTER_TEXT, CENTER_TEXT);outtextxy(x, y, "Press a key to close the graphics system:"); /* wait for a key */getch();/* closes down the graphics system */closegraph();printf("We're now back in text mode.\n");printf("Press any key to halt:");getch();return 0;}函数名: clreol功能: 在文本窗口中清除字符到行末用法: void clreol(void);程序例:#includeint main(void){clrscr();cprintf("The function CLREOL clears all characters from the\r\n"); cprintf("cursor position to the end of the line within the\r\n"); cprintf("current text window, without moving the cursor.\r\n"); cprintf("Press any key to continue . . .");gotoxy(14, 4);getch();clreol();getch();return 0;}函数名: clrscr功能: 清除文本模式窗口用法: void clrscr(void);程序例:#includeint main(void){int i;clrscr();for (i = 0; i < 20; i++)cprintf("%d\r\n", i);cprintf("\r\nPress any key to clear screen");getch();clrscr();cprintf("The screen has been cleared!");getch();return 0;}函数名: coreleft功能: 返回未使用内存的大小用法: unsigned coreleft(void);程序例:#include#includeint main(void){printf("The difference between the highest allocated block and\n"); printf("the top of the heap is: %lu bytes\n", (unsigned long) coreleft()); return 0;}函数名: cos功能: 余弦函数用法: double cos(double x);程序例:#include#includeint main(void){double result;double x = 0.5;result = cos(x);printf("The cosine of %lf is %lf\n", x, result);return 0;}函数名: cosh功能: 双曲余弦函数用法: dluble cosh(double x);程序例:#include#includeint main(void){double result;double x = 0.5;result = cosh(x);printf("The hyperboic cosine of %lf is %lf\n", x, result);return 0;}函数名: country功能: 返回与国家有关的信息用法: struct COUNTRY *country(int countrycode, struct country *country); 程序例:#include#include#define USA 0int main(void){struct COUNTRY country_info;country(USA, &country_info);printf("The currency symbol for the USA is: %s\n",country_info.co_curr);return 0;}函数名: cprintf功能: 送格式化输出至屏幕用法: int cprintf(const char *format[, argument, ...]);程序例:#includeint main(void){/* clear the screen */clrscr();/* create a text window */window(10, 10, 80, 25);/* output some text in the window */cprintf("Hello world\r\n");/* wait for a key */getch();return 0;}函数名: cputs功能: 写字符到屏幕用法: void cputs(const char *string);程序例:#includeint main(void){/* clear the screen */clrscr();/* create a text window */window(10, 10, 80, 25);/* output some text in the window */cputs("This is within the window\r\n");/* wait for a key */getch();return 0;}函数名: _creat creat功能: 创建一个新文件或重写一个已存在的文件用法: int creat (const char *filename, int permiss); 程序例:#include#include#include#includeint main(void){int handle;char buf[11] = "0123456789";/* change the default file mode from text to binary */ _fmode = O_BINARY;/* create a binary file for reading and writing */ handle = creat("DUMMY.FIL", S_IREAD | S_IWRITE); /* write 10 bytes to the file */write(handle, buf, strlen(buf));/* close the file */close(handle);return 0;}函数名: creatnew功能: 创建一个新文件用法: int creatnew(const char *filename, int attrib);程序例:#include#include#include#include#includeint main(void){int handle;char buf[11] = "0123456789";/* attempt to create a file that doesn't already exist */ handle = creatnew("DUMMY.FIL", 0);if (handle == -1)printf("DUMMY.FIL already exists.\n");else{printf("DUMMY.FIL successfully created.\n");write(handle, buf, strlen(buf));close(handle);}return 0;}函数名: creattemp功能: 创建一个新文件或重写一个已存在的文件用法: int creattemp(const char *filename, int attrib);程序例:#include#include#includeint main(void){int handle;char pathname[128];strcpy(pathname, "\\");/* create a unique file in the root directory */handle = creattemp(pathname, 0);printf("%s was the unique file created.\n", pathname); close(handle);return 0;}函数名: cscanf功能: 从控制台执行格式化输入用法: int cscanf(char *format[,argument, ...]);程序例:#includeint main(void){char string[80];/* clear the screen */clrscr();/* Prompt the user for input */cprintf("Enter a string with no spaces:");/* read the input */cscanf("%s", string);/* display what was read */cprintf("\r\nThe string entered is: %s", string);return 0;}函数名: ctime功能: 把日期和时间转换为字符串用法: char *ctime(const time_t *time);程序例:#include#includeint main(void){time_t t;time(&t);printf("Today's date and time: %s\n", ctime(&t)); return 0;}函数名: ctrlbrk功能: 设置Ctrl-Break处理程序用法: void ctrlbrk(*fptr)(void);程序例:#include#include#define ABORT 0int c_break(void){printf("Control-Break pressed. Program aborting ...\n"); return (ABORT);}int main(void){ctrlbrk(c_break);for(;;){printf("Looping... Press to quit:\n");}return 0;}。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Longjmp(){ 跳转到保存 envbuf 参数的 setjmp 函数调用返回,此时
setjmp 返回值就是 val。 }
[这个是瞎扯的不知道 望)
信号函数
]long( 渴
Signal(){设置信号处理 Siganal(信号 ) 方式 }
Raise(){向正在执行的 程序发送信号 sig}
Raise(发出 )
is upper_case(大写 ) is hexadecimal digit( 十六进制 )
这个简单( to change 或者 to covert 或者
transformation
字符串函数
Memchr(){ 在某一内存范围内 查找一特定字符 }
Memory ( 储存 )char(字符型 炭 )也可以是 character (字
String()char(字符 )
Strcmp(){ 比较字符串 str1 和 str2 }
Compare(比较 )
Strcoll(){ 以环境变量
LC_COLLATE所指的文字排列次序
来比较 s1 和 s2}
[参考用 ]Collate( 整理 对照 )
Strcpy(){把 src 所指由 NULL 结
Ferror(){ 检查文件是否 File(文件 )error( 错误 ) 有错误 }
Fflush(){fflush() 会强迫将缓冲 File(文件 )flush( 强行赶出 把什 区内的数据写回参数 stream 指定 么清除 )
的文件中 . 如果参数 stream 为
NULL,fflush() 会将所有打开的文件
符)
Memcmp(){ 比较区域 str1,str2 的前 n 个字节 }
Memory( 同理 )compare( 比较 )
Memcpy(){ 由 str2 所指内存区域复 Memory
制 n 个字节到 str1 所指内存区域 }
copy(复制 )
Memmove(){ 两个所指的内存区域 可重叠,但是内容会更改,函数 返回值为指向区域内存的指针 }
指定的文件流所使用的错误旗
标.}
Clear(清除 )error( 错误 )
Fclose(){fclose() 用来关闭先前
fopen() 打开的文件 . 此动作会让
缓冲区内的数据写入文件中 , 并
释放系统所提供的文件资
源 .}[ 只要出现错误标 志,就一直保留,直 到对同一文件调用 clearerr() 函数或者 rewind() 函数,或者任 意一个输入输出函数
Abort(){} Abs(){} Atexit(){} Atof(){} Atoi(){}
标准工具库函数
Atol(){} Bsearch(){} Calloc(){} Div(){} Exit(){} Free(){} Getenv(){}
Labs(){} Ldiv(){} Molloc(){} Mblen(){} Mbstowcs(){} Mbtowc(){} Qsort(){}
数据更新 .}
Fgetpos(){依据当前文 件的句柄,获取访问 当前指针位置信息 }
File(文件 )get(获取 )position( 位 置)
Fgetc(){文件指针 stream 指向的文件中 读取一个字符,读取 一个字符后,光标位 置后移一个字节。 }
Fgets(){获取流 }
File(文件 )get(获取 )char(字符 ) Get(获取 )stream( 流 )
Memory
Memset(){ 把 str 所指的内存区域 的前 N 个字节设置成字符 c}
move(移动 ) Set(设置 )
Strcat(){把 src 所指字符串添加 String(字符串 )catch(赶上 ) 到 dest 结尾处的 ’\0}’
Strncat(){ 从字符串 src 的开头 String(字符串 )n(数 )catch(赶上 )
Toke down(拆掉 拆台 )
Strxfrm(){ 使用当前的区域设 置来转换字符串 }
断言函数
Assert(){测试一个条件 并可能是程序终止 }
Assert(断言 主张 坚持 生效 维护 )[这个单词我看过 n 遍就 是记不住 ]
本土化函数
Localeconv(){返回当前 Locale(现场 场所 )convey(传
Clearerr() 函数和 ferror() 函数应该配合 使用,通过 ferror() 函 数检测出文件有错误 标志后要使用 clearerr() 函数复位标 志错误 ]
File(文件 )close(关闭 )
Feof(){检查文件是否 读到了文件末尾 }
File(文件 )end off( 结尾 )
可变参函数
Va_start(){ 获取参数列 Variable(可变的 )start( 开始 ) 表中的参数 }
Va_arg(){获取参数 }
Variable(可变的 )argument( 参数 )
Va_end(){关闭指针 } End(结束 ) 输入输出函数
Clearerr(){ 清除参数 stream
C 语言函数大全
1 字符测试函数 函数(及意义) Isalnum(){ 判断字符是否 为字母或数字 } Isalpha(){判断是否为英文 字母 } Isblank(){空格和 TAB} Iscntrl() { 控制 } Isdigit(){ 数字 } Isgraph(){除空格外的可打 印字符 } Islower(){ 是否为小写 } Isprintf(){ 可打印字符含空 字符 } Ispunct(){ 标点或特殊符号 } Isspace(){检查是否为空字
Floor(底部 地板 地面 )
Fmod(){ 计算给定值的 余数 }
Figure(计算 )mode( 余数 )
Frexp(){把一个双精度 Figure() exponent( 指数 ) 数分解为尾数的指数 }
Idexp(){ 计算指定的幂 次数 }
Identify( 确认 明验 )[引申为指 定]
exponent( 指数 )
Pow(){计算 “ x的”“ y次” [不知道啊 ] 幂}
Modf(){ 计算给定浮点 数的小数部分 }
Mode( 模 ) Figure(计算 )[模的计 算]
跳转函数
Setjmp(){ 存储当前运 行环境 environment 变量中 }
Set(配置 )jump( 跳跃点 )
地域设置的信息 }
达,运输,表达 )
Setlocale(){配置地域化 Set(安排 规定 ) 信息函数 }
数学函数
(几个简单的就不说了,也没有特定的英文比如 角函数 )
sin 三
Ceil(){计算不小于某数 的最小整数 }
Ceiling(天花板 上限 最高限度 最大额度 )
Floor(){计算不大于某 数的最大整数 }
Rand(){} Realloc(){} Srand(){} Strtod(){} Strtol(){} Strtoul(){} System(){}
Wcstombs(){} Wctomb(){}
时间和日期函数 Asctime(){} Clock(){} Ctime(){}
Difftime(){} Gmtime(){} Localtime(){} Mktime(){} Strftime(){} Time(){}
这个简单
Strlen(){ 计算指定的字符串 s Length(长度 )
的长度,不包括结束字符 ‘\0 ’}
Strncmp(){ 比较字符串前 n 个 n(个数 ) 字符 }
Strncpy(){ 用来复制字符串前 n 个字符 }
Copy(复制 )
Strpbrk(){ 检索两个字符串中 首个相同字符的位置 }
拷贝 n 个字符到 dest 字符串尾
部, dest 要有足够的空间来容纳
要靠被的字符串。如果 n 大于字
符串的长度,那么仅将 src 全部追
加到 dest 的尾部。 Strncat()会将
dest 字符串最后的 ’ \0覆’盖掉,字
符追加完成后,在追加到 ’\0}’.
Strchr(){ 查找字符串中首次出 现字符 c 的位置 }
的开头计算连续的字符,而这些
字符完全是 accept 所指字符串中
的字符。若 strspn() 返回的数值为
n,则代表字符串 str 开头连续有
n 个字符都属于字符串 accept 内
贯穿 )
的字符 }
Strstr(){ 检索子串在字符串中首 次出现的位置 }
这个简单
Strtok(){ 分解字符串为一组字 符串 }
束的字符串复制到 dest 所指的数
组中 }
Copy(复制 )
Strcspn(){顺序在字符串 s1 中
搜寻与 s2 中相同字符,包括结束 符 NULL,返回这个字符在 s1 中
的一次出现的位置。 }
Character(特征 )span(横跨 贯 穿)
[特征: s2 字符 ]
小写 }
函数分解 is alphbet( 字母表 ) number( 数字 ) is alphbet (字母表) is blank(空格 ) is control( 控制 ) is digit( 数字 )
is graph(图表 ) is lowercase(小写 ) 这个简单 is punctuation( 标点 ) is space(空间 )
符,即判断是否为空格,水平
定位字符“ \t ” ,归位字符“ \r
”,垂直定位字符“ \v ” ,换行
字符“ \n ”,翻页“ \f ” } Isupper(){ 是否为大写字母 } Isxdigit(){ 十六进制 } Tolower(){ 将小写转换成 大写 } Toupper(){将大写转换成