怎么找C++函数需要的头文件?(C++头文件、C++函数文档、C++文档、cpp文档、cpp头文件、cpp函数文档、cppman)

文章目录

C++

cppreference.com

上面这个不太稳定啊,有时连不上
下面这个貌似可以

C++ 参考手册

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
下面还有解释和代码示例
在这里插入图片描述

http://cplusplus.com/

这个网站还可以
在这里插入图片描述

C语言

这还有C语言的,不过貌似不怎么全
https://www.apiref.com/c-zh/index.htm

在这里插入图片描述

有网友推荐了一个cppman(这个好)

在我的ubuntu里安装:sudo apt install cppman

[root@ubuntu /arnold_test/20220511_CPP_socket_client_server]91# cppman
What manual page do you want?
[root@ubuntu /arnold_test/20220511_CPP_socket_client_server]92# cppman -h
Usage: cppman [OPTION...] PAGE...

Options:
  -s SOURCE, --source=SOURCE
                        Select source, either 'cppreference.com' or
                        'cplusplus.com'. Default is 'cplusplus.com'.
  -c, --cache-all       cache all available man pages from cppreference.com
                        and cplusplus.com o enable offline browsing
  -C, --clear-cache     clear all cached files
  -f KEYWORD, --find-page=KEYWORD
                        find man page
  -o, --force-update    force cppman to update existing cache when '--cache-
                        all' or browsing man pages that were already cached
  -m MANDB, --use-mandb=MANDB
                        Accepts 'true' or 'false'. If true, cppman adds
                        manpage path to mandb so that you can view C++
                        manpages with `man' command. The default value is
                        'false'.
  -p PAGER, --pager=PAGER
                        Select pager to use, accepts 'vim', 'less' or
                        'system'. 'system' uses $PAGER environment as pager.
                        The default value is 'vim'.
  -r, --rebuild-index   rebuild index database from cplusplus.com
  -v, --version         show version information
  -h, --help            show this help message and exit
[root@ubuntu /arnold_test/20220511_CPP_socket_client_server]93# 

我先下载一下离线文档:cppman -c
在这里插入图片描述
比如要查找这个find()函数,cpp man -f find
在这里插入图片描述
然后我们输入cppman std::string::find,就能看到关于这个函数的文档了
在这里插入图片描述
如果不喜欢用vim打开,可以设置为system方式打开

cppman -p system

猜你喜欢

转载自blog.csdn.net/iijik55/article/details/124891683
今日推荐