MAN查看库函数语法和所在头文件
来源:互联网 发布:vps绑定阿里域名 编辑:程序博客网 时间:2024/06/05 10:42
转载自:http://www.jishuziyuan.com/archive/sinekary/7925378.html
每次想查某个C库函数的文件时,总是上网搜,然后在博客里看到。有是还得看好几篇,才找到。
这不是办法呀,window有MSDN,linux有MAN,怎么不去用呢?
1. 查看man(manual)手册说明,看,man既是动词,又是名词,它还是形容词(他好man哦)
$ man man
The table below shows the section numbers of the manual followed by the types of pages they contain.
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
可以看到,第3条是显示库函数的手册。
2. 查看printf头文件
$ man 3 printf
查看格式化说明符,可以搜索specifier
The conversion specifier
A character that specifies the type of conversion to be applied. The conversion specifiers and their meanings are:
d, i The int argument is converted to signed decimal notation. The precision, if any, gives the minimum number of digits that must appear; if the converted value
requires fewer digits, it is padded on the left with zeros. The default precision is 1. When 0 is printed with an explicit precision 0, the output is empty.
o, u, x, X
The unsigned int argument is converted to unsigned octal (o), unsigned decimal (u), or unsigned hexadecimal (x and X) notation. The letters abcdef are used
for x conversions; the letters ABCDEF are used for X conversions. The precision, if any, gives the minimum number of digits that must appear; if the converted
value requires fewer digits, it is padded on the left with zeros. The default precision is 1. When 0 is printed with an explicit precision 0, the output is
empty.
查看所在头文件,就在开头SYNOPSIS标题下
PRINTF(3) Linux Programmer's Manual PRINTF(3)
NAME
printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - formatted output conversion
SYNOPSIS
#include <stdio.h>
int printf(const char *format, ...);
int fprintf(FILE *stream, const char *format, ...);
如果直接:
$ man printf
则默认显示的是第1条:可执行程序或shell命令
1 Executable programs or shell commands
- man查看库函数语法和所在头文件
- MAN查看库函数语法和所在头文件
- ubuntu man查看 系统调用和库函数
- VIM中查看头文件和库函数的方法
- C语言中常用的库函数,及它的作用和所在头文件
- C语言中常用的库函数,及它的作用和所在头文件(转)
- C语言中常用的库函数,及它的作用和所在头文件
- cscope和ctags添加头文件的索引,查看系统库函数
- 查看内核中函数所在的头文件
- 头文件和库函数的区别
- vim中查看头文件、库函数的方法
- 函数所在头文件
- linux 下使用 man 查看 c++ 库函数
- C++库函数头文件
- c++库函数头文件
- Stm32库函数头文件
- C,C++常用函数和所在头文件
- linux 查找系统调用和库函数头文件
- javascript setHours()方法
- STL迭代器失效问题
- diff 工具使用 ,如何为Linux生成和打上patch
- HDU3183(RMQ问题,ST算法)
- ld: warning: PIE disabled.
- MAN查看库函数语法和所在头文件
- Android AIDL应用间交互
- 用实例给新手讲解RSA加密算法
- Address already in use: JVM_Bind错误的解决
- Windows7通过telnet连接服务器
- 无法定位序数于动态库mfc90d.dll上 由于应用程序配置不正确...解决方法
- jquery获取浏览器类型和版本号方法
- Spring Batch(一)
- cs硕士妹子找工作经历【阿里人搜等互联网】