![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL
凉冰难消一腔热血
在读通信专业的研究生一枚
展开
-
c++中 string 和 int 类型转换
在C++编程的时候,有时需要将string类型转为int类型,则需要进行2部分:1、首先将 字符串string 转为 C语言中的 const char* 类型(使用 _c.str()函数)2、将 const char* 转为 int 类型(使用atoi(const char *)函数)注意:.c_str()函数在#include<string>的头文件中 atoi()函数在#include<stdlib.h>的头文件中,如果使用,则必须包含该头文...原创 2020-09-17 21:31:05 · 15965 阅读 · 1 评论 -
C++中STL---accumulate累积函数
accumulate: 功能描述:计算区间内 容器元素累计总和 算法简介:accumulate(iterator beg, iterator end, value); //计算容器元素累计总和 //[b...原创 2020-10-04 19:14:39 · 2669 阅读 · 3 评论