CPlusPlus 学习
C++学习过程,知识点总结
贷勇的人
reference是用来啃的,诸君共勉
展开
-
C++ Primer Reading
PrefaceMy answer of the Program tests in this book.Chapter one//Num 1:std::cout << "My name is Feishi , and my address is 127.0.0.1." << std::endl;//Nmu 2:long dis;std::cout << "Please input a number:";std::cin >> dis;std::原创 2021-01-26 03:53:49 · 216 阅读 · 0 评论 -
Qt小作品Online Chat(s/c)
前言qt学习有小段时间了,这几天一直考虑做一点什么。找了一些有意义的资料,作了很多参考。于是写了个特别简易的s/c形式地onlinechat。运行图ClientCodeclient.cpp#include "client.h"#include "ui_client.h"#include <QHostAddress>client::client(QWidget *parent) : QWidget(parent), ui(new Ui::client){原创 2021-01-09 02:14:04 · 377 阅读 · 0 评论 -
C++ stack知识总结
文章目录前言ConstructCapaticy&Modify前言stack,也就是栈,特征是filo/lifo,声明在stack.h文件中。Constructstack<valuetype> e; //创建空栈.stack<valuetype, container type<valuetype> > e; //创建空栈,指定底层实现容器.stack<value type> e(container object); //以object内成原创 2020-12-31 21:57:18 · 268 阅读 · 0 评论 -
C++ priorityqueue知识总结
文章目录ConstructFeatureiteratorCapaticyMultifyc++模板中关于priorityqueue的声明在queue头文件中,因此使用时要#includeConstruct重载两种形式priority_queue<int>;priority_queue<valuetype,container,bool compare>;Featurebased on container;‘compare’ is a functor;example原创 2020-12-30 14:33:50 · 285 阅读 · 0 评论 -
C++ string知识总结
文章目录前言ConstructIteratorCapacityElement accessModify前言关于学习、了解string相关方法的定义及功能,官方参考手册是最好的地方,权威、客观、简明扼要,没有歧义。这是官方文档的地址:C++官方文档Constructstring string1; //construct an empty string nstring string2=string1; string string3=string(string 2,8,3); //for (int原创 2020-12-29 12:07:51 · 163 阅读 · 0 评论 -
C++Lambda表达式
文章目录前言lambda表达式结构capture listparameter list&return value&function bodyexample前言lambda在数学里写作-λ,俗称匿名表达式,使用它的目的是为了简化代码结构,增强可读性。例如当重定义algorithm头文件中的sort方法的参数三时候,可以不单独使用代码段声明新方法作参数,可以进行如下操作:sort(std::vector<int>:: begin,std::vector<int>:原创 2020-12-28 10:31:38 · 161 阅读 · 0 评论 -
C++ Deque知识总结
文章目录前言前言关于学习、了解deque相关方法的定义及功能,官方参考手册是最好的地方,权威、客观、简明扼要,没有歧义。这是官方文档的地址:C++官方文档原创 2020-12-25 16:24:36 · 150 阅读 · 0 评论 -
C++ Array知识总结
http://www.cplusplus.com/原创 2020-12-21 21:53:26 · 297 阅读 · 0 评论 -
C++ 贪吃蛇小游戏(CLI)
文章目录前言设计思路实现过程运行测试前言我大二的时候用c写过一个跑出五格就越界的贪吃蛇,现在看来简直是一堆垃圾。我现在用cplusplus重写它,那就叫它垃圾plusplus好了(狗头)。设计思路贪吃蛇行为过程:1.蛇吃果子2.蛇以speed运动3.蛇在ground上运动4.果子以frquency为间隔出现5.果子出现在在ground上6.蛇的头撞到了空气和果子之外的物体会死实现过程backg.h文件:#include<vector>#include<wind原创 2020-12-15 23:47:02 · 442 阅读 · 0 评论 -
C++ Vector知识总结
文章目录前言前言关于学习、了解vector相关方法的定义及功能,官方的参考手册毋庸置疑是最好的地方,权威、客观、简明扼要,没有歧义。这是官方文档的地址:C++官方文档原创 2020-12-11 16:54:17 · 639 阅读 · 0 评论