简体   繁体   English

“ stdio”和“ stdlib”在C中代表什么?

[英]What does “stdio” and “stdlib” stand for in C?

And is there anywhere that explains all the shorthand library names? 哪里有解释所有速记库名称的地方? I don't want documentation on what the libraries do, I just want to know what the titles are short for. 我不需要有关库功能的文档,我只想知道标题的缩写。 Are they abbreviations? 他们是缩写吗?

OK, how about getting a list going then: 好的,然后如何获取列表:

  • "stdio": standard input/output “ stdio”:标准输入/输出
  • "stdlib": standard library “ stdlib”:标准库
  • "printf": print formatted “ printf”:打印格式
  • "fprintf": file print formatted ("print formatted to file") “ fprintf”:格式化文件的打印(“格式化为文件的打印”)
  • "sprintf": string print formatted ("print formatted to string") “ sprintf”:格式化的字符串打印(“格式化为字符串的打印”)
  • "vfprintf": variadic fprintf “ vfprintf”:可变参数fprintf
  • "fputc": file put char ("put char into file") “ fputc”:文件放入char(“将char放入文件”)
  • "scanf": scan formatted “ scanf”:扫描格式
  • "fread": file read ("read from file") “ fread”:已读取文件(“从文件读取”)
  • "pthread": Posix thread “ pthread”:Posix线程
  • "uint16_t": unsigned integral type, 16 bits wide “ uint16_t”:无符号整数类型,16位宽
  • "sigatomic_t": a type that can be accessed atomically in signal handlers “ sigatomic_t”:可以在信号处理程序中原子访问的类型
  • "_t" in general: A suffix reserved for type names in the standard library. 通常为“ _t”:为标准库中的类型名称保留的后缀。
  • "float": floating point number “ float”:浮点数
  • "double": double-precision floating point number “ double”:双精度浮点数
  • "char": character “ char”:字符
  • "bit": binary digit “位”:二进制数字
  • "fd": file descriptor “ fd”:文件描述符
  • "fcntl.h": file control (Posix file descriptors) “ fcntl.h”:文件控件(Posix文件描述符)
  • "ioctl.h": I/O control (also Posix) “ ioctl.h”:I / O控制(也为Posix)
  • "stat": status of a file (also Posix) “ stat”:文件的状态(也为Posix)
  • "lstat": status, possibly of a link itself “ lstat”:状态,可能是链接本身
  • "fstat": status of a file descriptor “ fstat”:文件描述符的状态
  • "sleep": interrupt normal activity in favour of no activity at all “睡眠”:中断正常活动,而完全不活动
  • "usleep": version of the above that takes argument in microseconds (µs), with 'u' looking a bit like 'µ' whilst being basic ASCII “ usleep”:以上版本的参数,以微秒(µs)为单位,其中'u'看起来有点像'µ',而它是基本ASCII
  • "recv": receive “ recv”:接收
  • "creat": create “创建”:创建
  • "str": string, in C this usually refers to null-terminated char arrays “ str”:字符串,在C中,这通常是指以null结尾的char数组
  • "strtok": tokenize string “ strtok”:标记化字符串
  • "pow": power “战俘”:力量
  • "frexp": fractional part (significand) and exponent “ frexp”:小数部分(有效位数)和指数
  • "abs": absolute value “ abs”:绝对值
  • "malloc": memory allocate “ malloc”:内存分配
  • "calloc": allocate and clarify that the initial state is zero “ calloc”:分配并阐明初始状态为零
  • "wcsrtombs": wide character string to multibyte string, reentrant “ wcsrtombs”:宽字符串到多字节字符串,可重入
  • "wctomb": wide character to multibyte character(s) “ wctomb”:宽字符到多字节字符
  • "iconv": ??? “ iconv”:???
  • "uconv": ICU version of "iconv" “ uconv”:ICU版本的“ iconv”

标准I / O(输入输出)和标准库

You want to know how to find these for yourself. 您想知道如何为自己找到这些。 (I like Kerrek SB's list, but I can't blame you for wanting to know how to look these things up on your own.) (我喜欢Kerrek SB的列表,但不能怪您想知道如何自行查看这些内容。)

First things first: If you're on Debian or Ubuntu, I strongly recommend installing the manpages-posix and manpages-posix-dev packages in addition to the usual manpages package. 首先,第一件事:如果您使用的是Debian或Ubuntu,我强烈建议您除了通常的manpages软件包之外,还安装manpages-posixmanpages-posix-dev软件包。 These give you access to the standards in addition to the Linux man-pages project . 除了Linux手册页项目之外,这些还使您可以访问标准

The difference is immediately visible with: 区别立即可见:

man 2 close       # gives you the Linux documentation of the system call
man 3posix close  # gives you the POSIX definition of the function

You can also see the difference for functions that aren't likely to be system calls: 您还可以看到不太可能是系统调用的函数的区别:

man 3 qsort       # Linux man-pages project describing the glibc function
man 3posix qsort  # POSIX standard definition of the function, should be useful
                    description for any POSIX-compliant system

I also recommend installing the dict , dictd , and dict-jargon or dict-foldoc (or both) packages: 我还建议安装dictdictddict-jargondict-foldoc (或两者)软件包:

$ dict stdin
2 definitions found

From The Free On-line Dictionary of Computing (26 July 2010) [foldoc]:

  standard input/output
  standard I/O
  stderr
  stdin
  stdio
  stdout

     <programming, operating system> The predefined input/output
     channels which every {Unix} process is initialised with.
     Standard input is by default from the terminal, and standard
     output and standard error are to the terminal.  Each of these
     channels (controlled via a {file descriptor} 0, 1, or 2 -
     stdin, stdout, stderr) can be redirected to a file, another
     device or a {pipe} connecting its process to another process.
     The process is normally unaware of such {I/O redirection},
     thus simplifying prototyping of combinations of commands.

     The {C} programming language library includes routines to
     perform basic operations on standard I/O.  Examples are
     "printf", allowing text to be sent to standard output, and
     "scanf", allowing the program to read from standard input.

     (1996-06-07)


From V.E.R.A. -- Virtual Entity of Relevant Acronyms (June 2006) [vera]:

  STDIN
         STandarD INput

$ dict stdlib
No definitions found for "stdlib"
$ 

(Hilarious, right? Doesn't have one of the ones you wanted. But still, they're wonderful tools.) (搞笑,对吗?没有您想要的一种。但是,它们仍然是很棒的工具。)

stdio: Standard Input/Output 标准输入/输出

http://www.cplusplus.com/reference/clibrary/cstdio/ http://www.cplusplus.com/reference/clibrary/cstdio/

"...using the C Standard Input and Output Library (cstdio, known as stdio.h in the C language)" “ ...使用C标准输入和输出库(cstdio,在C语言中称为stdio.h)”

stdlib: Standard Library stdlib:标准库

http://www.cplusplus.com/reference/clibrary/cstdlib/ http://www.cplusplus.com/reference/clibrary/cstdlib/

"C Standard General Utilities Library This header defines several general purpose functions..." “ C标准通用实用程序库此标头定义了几个通用功能...”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM