您可以使用man -wK 'sizeof' | sort -u
查找包含的文章sizeof
,但这会返回很多结果。但请注意,每篇关于某事的文章都会将这个东西作为一个被空格包围的裸字,我们会搜索这样的文章zgrep -P '\ssizeof\s' /usr/share/man/man3/*
。但是在第3节中搜索并没有给出任何有用的信息,所以我将在第7节中搜索
$ zgrep -P '\ssizeof\s' /usr/share/man/man7/*
/usr/share/man/man7/inotify.7.gz: len = read(fd, buf, sizeof buf);
/usr/share/man/man7/operator.7.gz:! ~ ++ \-\- + \- (type) * & sizeof right to left
正如您所看到的,sizeof
在操作员手册页中提到了,因为它不是一个函数而是一个操作符,即使没有sizeof buf
上述标识符的括号也可以工作
OPERATOR(7) Linux Programmer's Manual OPERATOR(7)
NAME top
operator - C operator precedence and order of evaluation
DESCRIPTION top
This manual page lists C operators and their precedence in
evaluation.
Operator Associativity
() [] -> . left to right
! ~ ++ -- + - (type) * & sizeof right to left
* / % left to right
+ - left to right
<< >> left to right
< <= > >= left to right
== != left to right
& left to right
^ left to right
| left to right
&& left to right
|| left to right
?: right to left
= += -= *= /= %= <<= >>= &= ^= |= right to left
, left to right
http://man7.org/linux/man-pages/man7/operator.7.html