C++
文章平均质量分 55
d531304890
这个作者很懒,什么都没留下…
展开
-
QT实现点击按钮打开或关闭新窗口
首先创建一个新窗口Mywindow类继承MainWindow类。然后,MainWindow.cpp文件代码如下:1、要求:点击OPEN开启另外一个窗口,点击CLOSE关闭该窗口#include "mainwindow.h"MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ setWindowTitle("窗口1"); resize(200,200); this->myw =new My原创 2021-03-23 16:49:40 · 4956 阅读 · 0 评论 -
STL-常用算法
1. 算法头文件#include<algorithm>是STL头文件最大的一个,涉及比较、交换、查找、遍历、复制、修改。#include<numeric>几个序列上的简单数学运算的模板函数。#include<functional>定义了一些模板类2. 遍历2.1 for_each遍历容器#include<iostream>#include<vector>#include<algorithm>using原创 2021-03-18 13:27:17 · 126 阅读 · 0 评论 -
C++容器命令
C++容器技术1. string容器1.1 定义:字符串1.2 头文件:include <string>1.3 构造 string str1;//初始化一个空的字符串 string str2 = "abc";//创建字符串str2,并赋值abc string str3(str2);//创建str3,并用str2初始化str3 string str4(5, 'a');//创建str4,并赋值为5个a1.4 赋值 string str1,str2,str3; str1 =原创 2021-03-17 20:28:25 · 162 阅读 · 0 评论