cppman模拟C?
问题描述:
我与C新,所以我想直接从控制台使用一些手册页。cppman模拟C?
在的Linux我可以用cppman
,得到提示有关VARIOS在C++功能,例如:
$ cppman printf | head -n 10
printf(3) C++ Programmer's Manual printf(3)
NAME
printf - Print formatted data to stdout
TYPE
function
有什么谎言这个工具,但专为Ç?
因为 - 有一些型动物,例如:
$ cppman printf | grep -A 4 SYNOPSIS
SYNOPSIS
#include <cstdio>
int printf (const char * format, ...);
UPD
展望man
没有给出结果:
$ man 3 printf
No entry for printf in section 3 of the manual
$ man -k printf
...
printf (1) - format and print data
printf [builtins] (1) - bash built-in commands, see bash(1)
...
而且还 - printf
这里只是举例,但磨损更复杂的项目? 例如:
$ man bool
No manual entry for bool
$ cppman bool | grep -A 8 EXAMPLE
EXAMPLE
// modify boolalpha flag
#include <iostream> // std::cout, std::boolalpha, std::noboolalpha
int main() {
bool b = true;
std::cout << std::boolalpha << b << '0;
std::cout << std::noboolalpha << b << '0;
return 0;
}
答
普通的旧man
会工作。您可以通过-S3
选项(或者只是3
)将结果限制为C标准库函数。如果在man结果中没有看到C标准库函数,则需要安装libc手册页集合。
'man printf'有什么问题? – 2014-12-07 20:39:36
@GregHewgill它将显示'printf(1)'的手册页,即shell命令。 – Sneftel 2014-12-07 20:41:38
确定,'man 3 printf'获取libc版本。在没有内置冲突壳体的情况下,“man”按预期工作。 – 2014-12-07 20:42:15