分享
 
 
 

一份c语言函数清单

王朝c/c++·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

http://www.phim.unibe.ch/comp_doc/c_manual/C/FUNCTIONS/funcref.htm

This is a summary of ANSI and POSIX functions grouped by library. If you want an alphabetical list, please use the master index. Please refer to a manual for a complete list of functions available to you.

ANSI standard library.

POSIX library.

Non Standard functions from CONIO.H

Non ANSI Standard Unix functions

User written functions.

Variable length argument lists.

ANSI standard library.The ANSI library is declared in the following header files. assert.h

ctype.h

errno.h

float.h

limits.h

locale.h

math.h

setjmp.h

signal.h

stdarg.h

stddef.h

stdio.h

stdlib.h

string.h

time.h

POSIX libraryThe POSIX library contains the following headers.

cpio.h

dirent.h

fcntl.h

grp.h

pwd.h

sys/stat.h

sys/times.h

sys/types.h

sys/utsname.h

sys/wait.h

tar.h

termios.h

unistd.h

utime.h

ANSII Library headersassert.h

assert ctype.h
isalnum Checks whether a character is alphanumeric (A-Z, a-z, 0-9)

isalpha

iscntrl Checks whether a character is a control character or delete ( decimal 0-31 and 127)

isdigit Checks whether a character is a digit (0-9)

isgraph Checks whether a character is a printable character, excluding the space (decimal 32)

islower Checks whether a character is a lower case letter (a-z).

isprint Checks whether a character is printable (decimal 32-126).

ispunct Checks whether a character is punctuation (decimal 32-47, 58-63, 91-96, 123-126)

isspace Checks whether a character is white space - space, CR HT VT NL, FF.

isupper Checks whether a character is an upper case letter (A-Z).

isxdigit Checks whether a character is hex digit (0-9, A-F, a-f).

toupper Converts a lowercase character to uppercase.

tolower Convert an uppercase character to lowercase. errno.h

errno float.hNo functions are declared in stddef.h. limits.hNo functions are declared in stddef.h. locale.h
setlocale

math.h

acos

asin

atan

atan2

ceil smallest integral value not less than x

cos Cosine.

cosh

exp

fabs absolute value of floating-point number

floor largest integral value not greater than x

fmod floating-point remainder function

frexp

ldexp

log

log10

modf

pow Raise a number by a power.

sin The sine of an integer.

sinh

sqrt Square root of a number.

tan Tangent.

tanh Hyperbolic tangent.

NoteFor some reason abs is in stdlib.h setjmp.h

setjmp

longjmp signal.h

signal

raise stdarg.h

va_start

va_arg

va_end

An example of use

See also vprintf vfprintf and vsprintf which all print the contents of a va_list stddef.hNo functions are declared in stddef.h. stdio.hThis header defines all the ANSI I/O functions that allow you to read and write to files and devices. Low level (non ANSI) functions are also available.

clearerr

fclose Close a file.

feof Check for EOF while reading a file.

fflush

fgetc Read a character from a file.

fgetpos

fgets Read a record from a file (safer than fgetc).

fopen Open a file

fprintf O/P a line of data to a file.

fputc Put a charater into a file.

fputs Put a string into a file.

fread

freopen

fscanf

fseek

fsetpos

ftell

fwrite

getc Get a character from an input stream.

getchar Get a character from the keyboard (STDIN).

gets Get string (from keyboard).

perror

printf O/P data to the screen or a file.

putchar O/P a character to STDOUT.

puts O/P data to the screen or a file.

remove Remove a file.

rewind

scanf

setbuf

setvbuf

sprintf O/P data in tha same way as 'printf' but put it into a string.

sscanf Extract fields from a string.

tmpfile

tmpnam

ungetc

vfprintf O/P a va_list to a file.

vprintf O/P a va_list to stdout.

vsprintf O/P a va_list to a string. stdlib.h

abort a program.

abs compute the absolute value of an integer.

atexit Execute the named function when the program terminates.

atof convert a string to a double

atoi Accepts +-0123456789 leading blanks and converts to integer.

atol convert a string to a long integer

bsearch Binary chop.

calloc memory for an array.

div compute the quotient and remainder of integer division

exit Normally terminate a program.

getenv Get an environmental variable.

free memory allocated with malloc.

labs compute the absolute value of a long integer

ldiv compute the quotient and remainder of long integer division.

malloc dynamically allocate memory.

mblen determine the number of bytes in a character

mbstowcs convert a multibyte string to a wide character string.

mbtowc convert a multibyte character to a wide character

qsort Sort an array.

rand Generate a random number.

realloc Reallocate memory.

strtod Convert a string to a double.

strtol String to long integer conversion. Takes data in various number bases.

strtoul Convert a string to an unsigned long. This can also perform number base conversion.

srand Seed a random number.

system Issue a command to the operating system

wctomb convert a wide character to a multibyte character.

wcstombs convert a wide character string to a multibyte character string. string.h

memchr Copy a character into memory.

memcmp Compare memory locations.

memcpy Copy memory.

memmove Move memory.

memset Set memory.

strcat Concatinate two strings.

strchr Search for a character in a string.

strcmp Compare strings.

strcoll

strcpy Copy strings.

strcspn

strerror

strlen Length of a string.

strncat Concatinate two strings.

strncmp Compare two strings.

strncpy Copy part of a string.

strpbrk

strrchr Search for a character in a string.

strspn

strstr Search a string for a substring.

strtok The books say this function splits a string into tokens. I think its function is best described as parsing a string.

strxfrm time.h

asctime

clock

ctime

difftime

gmtime

localtime

mktime

strftime

time

Example program using some of the time functions.

POSIX functions start here....cpio.hdirent.h

opendir Open a directory.

closedir Close a directory.

readdir Read a directory entry.

rewinddir Return to the beginning of a directory.

scandir Scan a directory for a matching entry.

seekdir Move to an offset in a directory.

telldir Return the location within a directory. fcntl.hgrp.hpwd.hsys/stat.hsys/times.hsys/types.hsys/utsname.hsys/wait.htar.htermios.hunistd.hIt seems that this library contains headers for many functions that originally came with the ANSII standard library but did not have headers. My documentation for this POSIX library is incomplete.

access

alarm

chdir Change the current working directory.

chown Change the ownership of a file.

close Close a file (see low level functions)

chroot Change the root directory I am not 100% sure this is supposed to be in unistd.

ctermid

cuserid

dup duplicate a file descriptor

dup2 duplicate a file descriptor

execl

execle

execlp

execv

execve

execvp

fchdir Change the current working directory.I am not 100% sure this is supposed to be in unistd.

fork Create a child process.

fpathconf Change the current working directory.I am not 100% sure this is supposed to be in unistd.

getegid Get the group ID of the process.

geteuid Get the User ID of the process.

gethostname Name of the host (see uname). Not 100% sure this is in unistd

getopt, parse the command line Not 100% sure this is in unistd.

getgid Get a group ID.

getgroups

getlogin

getpgrp

getpid get process ID.

getppid, get parent process ID.

getuid Get the User ID of the process.

isatty

link

lseek

mkdir Make a directory

open Open a file

pathconf

pause Put the program to sleep.

pipe

read Read a file descriptor.

rename Rename a file. This function can also be found in the ANSI stdio library. MAN PAGE.

rmdir Remove a directory

setgid Set the Group ID of the process.

setpgid

setsid

setuid Set the User ID of the process.
sleep Pause for a required number of seconds.

sysconf

tcgetpgrp

tcsetpgrp

ttyname

unlink Remove a file

write Write to a file descriptor. utime.hconio.hDos Specific functions in conio.h Not very portable as conio.h is NOT in the ANSI standard library and does not appear on the Sun or Linux machines.

clrscr Clear screen

getch Get a character from the keyboard.

getche Get a character from the keyboard.

Non ANSI Standard Unix Functions.These functions are not in the ANSI standard libraries but are handy all the same.

dirent.h Functions performing actions on directories

statfs Filesystem statistics.

unistd.h

Ungrouped functions.

Ungrouped functions

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有