我正在尝试查找“string.h”的手册条目,我已安装 GNU gcc。但是当我输入时man string.h
,它显示no manual entry for string.h
,我不确定出了什么问题?有人能帮我吗?谢谢!
答案1
使用man man
,我们可以看到手册页分为以下部分:
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 节是针对的functions within program libraries
,即通常记录的是单个函数,而不是特定的头文件。例如man strncpy
:
STRCPY(3) Linux Programmer's Manual STRCPY(3)
NAME
strcpy, strncpy - copy a string
SYNOPSIS
#include <string.h>
char *strcpy(char *dest, const char *src);
char *strncpy(char *dest, const char *src, size_t n);
DESCRIPTION
The strcpy() function copies the string pointed to by src, including
the terminating null byte ('\0'), to the buffer pointed to by dest.
The strings may not overlap, and the destination string dest must be
large enough to receive the copy. Beware of buffer overruns! (See
BUGS.)
etc.
在这种情况下,有一个概述man string
(因为有stdio
- 但显然没有stdlib
)
STRING(3) Linux Programmer's Manual STRING(3)
NAME
stpcpy, strcasecmp, strcat, strchr, strcmp, strcoll, strcpy, strcspn,
strdup, strfry, strlen, strncat, strncmp, strncpy, strncasecmp, strp‐
brk, strrchr, strsep, strspn, strstr, strtok, strxfrm, index, rindex -
string operations
SYNOPSIS
#include <strings.h>
etc.
NB 不要与 man strings
它记录了strings
目录第 (1) 节中的命令行实用程序。