上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 28 下一页
摘要: 头文件:#include <vector> 1.vector容器的内存开辟方式 vector容器和数组比较相似,但是开辟空间的方式不同。 (1)当vector对象的容量满了之后,在插入一个数据时,并不一定是再开辟一个空间,可能是会一次性多开辟几个空间,避免了下次再插入数据的时候需要频繁开辟空间的消耗 阅读全文
posted @ 2021-01-07 20:11 maycpou 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 1.使用compare进行string的比较,规则是:每个字符依次比较ASCII码大小,一有大于或者小于就返回,相等则继续比较下一个字符 (1)string对象str与string对象str1进行比较,大于返回1,等于返回0,小于返回-1 string str = "hello"; string s 阅读全文
posted @ 2021-01-02 15:18 maycpou 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 在C语言里面,字符串用char*来声明。在c++中定义了string类,包含在头文件<string>中。 string中封装了char*,是一个char*的容器,并且提供了很多实用的成员方法。 使用string的时候不用像char*需要考虑内存的释放和越界,这些都由string类内部进行管理。 1. 阅读全文
posted @ 2020-12-29 20:20 maycpou 阅读(77) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>//std::cout std::endl 屏幕输出需要的头文件#include <vector>//vector容器和vector迭代器需要的头文件#include <algorithm>//for_each算法需要的头文件 //声明一个for_each算法需 阅读全文
posted @ 2020-12-28 20:12 maycpou 阅读(88) 评论(0) 推荐(0) 编辑
摘要: C++中的标准库是使用c++语言写代码的时候使用的基础库,不需要安装。 标准模板库(STL)是标准库的一部分,与C++标准库的区分不明显,只是说指定的那几个头文件下所包含的内容就是属于标准模板库的。 标准模板库的头文件一般包括以下几个:<algorithm>、<deque>、<functional> 阅读全文
posted @ 2020-12-25 20:36 maycpou 阅读(453) 评论(0) 推荐(1) 编辑
摘要: 参考:https://www.jianshu.com/p/a67aa26134d4 stl,Standard Template Library的简称,是C++的一个标准模板库,是C++标准库的一部分,里面提供了很多我们在编码过程中常用的一些模板。 主要包含以下六大组件: 1、容器(container 阅读全文
posted @ 2020-12-25 20:17 maycpou 阅读(166) 评论(0) 推荐(0) 编辑
摘要: int a = 5; int* b = &a;//这里写成int *b = &a;是等价的 *b = 6; int* b = &a;表示定义一个int类型的指针b,该指针指向a变量的地址。*b = 6;表示将b指针指向地址存储的值改为为6,这时候a变量的值也变为了6,因为a变量的地址所存储值已经被修 阅读全文
posted @ 2020-12-25 17:02 maycpou 阅读(1234) 评论(0) 推荐(0) 编辑
摘要: apt-get update sudo apt install git build-essential linux-libc-dev 源码安装cmake: apt install lrzsz 安装上传下载的工具 apt install unzip 安装解压缩工具 apt-get install li 阅读全文
posted @ 2020-12-17 14:01 maycpou 阅读(760) 评论(0) 推荐(0) 编辑
摘要: free –m:查看内存大小 df:查看磁盘大小 cat /proc/cpuinfo:查看cpu信息,其中siblings为单个CPU逻辑物理核数 lspci |grep VGA:查看显卡型号 阅读全文
posted @ 2020-12-17 13:59 maycpou 阅读(890) 评论(0) 推荐(0) 编辑
摘要: 使用vs2019创建了一个简单的c++控制台项目,该程序就向控制台输出一句“hello world!” 另一台无环境的win10计算机:原本只有Microsoft Visual C++ 2013 Redistributable(x64) 和Microsoft Visual C++ 2013 Redi 阅读全文
posted @ 2020-11-23 16:24 maycpou 阅读(1925) 评论(0) 推荐(1) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 28 下一页