C++标准库(`std`命名空间)中包含了许多常用的函数,涵盖了各种功能和领域。以下是一些常见的函数:
1. 输入/输出相关函数:`cin`, `cout`, `cerr`, `clog`, `getline()`, `setw()`, `setprecision()`, 等等。
2. 容器相关函数:`vector`, `list`, `map`, `set`, `unordered_map`, `unordered_set`等容器的操作函数,如`push_back()`, `pop_back()`, `insert()`, `erase()`, `begin()`, `end()`等。
3. 算法相关函数:`sort()`, `find()`, `binary_search()`, `accumulate()`, `transform()`, `copy()`, `remove()`, `reverse()`, `fill()`, 等等。
4. 字符串处理函数:`strlen()`, `strcpy()`, `strcat()`, `strcmp()`, `std::string`的各种成员函数,如`size()`, `substr()`, `find()`, `append()`等。
5. 数学函数:`sqrt()`, `pow()`, `sin()`, `cos()`, `tan()`, `abs()`, `ceil()`, `floor()`, `round()`等数学函数。
6. 内存管理函数:`new`, `delete`, `malloc()`, `free()`等。
7. 时间处理函数:`time()`, `ctime()`, `localtime()`, `strftime()`, `difftime()`等。
这些函数只是`std`命名空间中的一小部分,C++标准库还提供了更多的功能和函数,可根据具体需求来选择使用。