自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 收藏
  • 关注

原创 C++ FFmpeg 将视频转换成图片

【代码】C++ FFmpeg 将视频转换成图片。

2023-05-31 15:30:23 785

原创 vs项目转cmake(.sln转CMakeLists.txt)

.sln文件转CMakeLists.txt

2023-03-21 21:19:48 5661 3

原创 Linux下的守护进程

Linux下的守护进程

2022-09-28 09:14:25 227

原创 QT:TestProperty

mypropertyclass.h#ifndef MYPROPERTYCLASS_H#define MYPROPERTYCLASS_H#include <QObject>class MyPropertyClass : public QObject{ //使用信号和槽 Q_OBJECT //使用动态属性 Q_PROPERTY(QString mask READ mask WRITE setMask NOTIFY maskChanged)public:

2020-11-18 19:21:05 157

原创 QT:singal信号和槽

#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QMainWindow>QT_BEGIN_NAMESPACEnamespace Ui { class MainWindow; }QT_END_NAMESPACEclass MainWindow : public QMainWindow{ Q_OBJECTpublic: MainWindow(QWidget *parent = nullptr); ~M

2020-11-18 19:15:59 128

原创 MYSQL笔记

CREATE DATABASE 库名; /*创建数据库*/SHOW databases; /*查看所有数据库*/use 库名; /*选择数据库*/drop database 库名; /*删除数据库*/show tables; /*查看所有表*/create table class(id int, name varchar(128), teacher varchar(64));/*创建表class*/insert into class values(101,'六年级一班','马

2020-09-28 12:39:15 88

原创 A*算法

Astar.cpp#include<math.h>#include"Astar.h"#include<iostream>#include<vector>static int *maze; //迷宫对应的二维数组,用一级指针表示static int cols; //二维数组对应的列数static int lines; //二维数组对应的行数static list<Point *> openlList; //开放列表static list

2020-09-25 10:44:30 93

原创 查找算法

并行搜素#include<iostream>#include <stdio.h>#include <iostream>#include <time.h>using namespace std;#define TEST_SIZE (1024*1024*200)#define NUMBER 20typedef struct _search { int *data;//搜索的数据集 size_t start; //搜索的开始位置 size_

2020-09-25 10:41:33 61

原创 五大核心算法

动态规划算法#include<iostream>using namespace std;/*递归实现机器人台阶走法统计参数: n - 台阶个数返回:上台阶总的走法f(n) = f(n-1) + f(n-2);*///分治算法int WalkCount1(int n){ if (n < 0) return 0; if (n == 1) return 1; //一级台阶,一种走法 else if (n == 2) return 2; //二级台阶,两种

2020-09-25 10:39:39 2800

原创 七大排序算法

插入排序#include<iostream>/*插入排序*/void InsertSort(int arr[], int len){ int preIndex = 0, current = 0; for (int i = 1; i < len; i++) { preIndex = i - 1; current = arr[i]; while (preIndex >= 0 && arr[preIndex] > current)

2020-09-25 10:37:10 119

原创 数据结构c++代码实现

顺序表#include<iostream>#include<string>using namespace std;//#define MAX_SIZE 100////typedef struct //{// int *elems; //顺序表的基地址// int length; //长度// int size; //总空间大小//}SqList;template <typename T>class SqList{public:

2020-09-25 10:33:49 2940

原创 C++:STL-常用集合算法

#include<iostream>#include<algorithm>#include<vector>using namespace std;//set_intersection 求两个容器的交集,返回最后一个元素位置//两个容器必须是有序的void test01(){ vector<int>v1 = { 0,1,2,3,...

2020-04-29 10:35:42 217

原创 C++:STL-常用算术生成算法

#include<iostream>#include<numeric>#include<vector>using namespace std;//算术生成算法属于小型算法,包含头文件numeric//accumulate 计算容器区间内元素累加总和void test01(){ vector<int>v1 = { 0,1,2,...

2020-04-29 10:35:02 170

原创 C++:STL-常用拷贝和替换算法

#include<iostream>#include<algorithm>#include<vector>using namespace std;//copy 将容器指定范围内的元素拷贝到另一容器中void vPrint(int num){ cout << num << " ";}void test01(){...

2020-04-29 10:34:07 127

原创 C++:STL-常用排序算法

#include<iostream>#include<algorithm>#include<vector>#include<functional>#include<ctime>using namespace std;//sort排序class nSort{public: bool operator()(int ...

2020-04-29 10:33:07 183

原创 C++:STL-常用查找算法

#include<iostream>#include<algorithm>#include<functional>#include<vector>#include<string>using namespace std;//find 查找元素,内置类型void test01(){ vector<int>v...

2020-04-29 10:31:46 158

原创 C++:STL-常用遍历算法

#include<iostream>#include<algorithm>#include<functional>#include<vector>using namespace std;//常用遍历算法for_each//普通函数void print(int val){ cout << val << "...

2020-04-29 10:30:32 188

原创 C++:函数对象-内建函数

逻辑仿函数#include<iostream>#include<functional>#include<vector>#include<algorithm>using namespace std;//逻辑非 logical_notvoid test01(){ vector<bool>v; v.push_bac...

2020-04-29 10:27:53 484

原创 C++:STL之map

#include<iostream>#include<map>using namespace std;//map中所有元素都是pair值,性能高//第一个元素为key(键值),起到索引作用,第二个元素为value(实值)//所有元素会根据键值排序,关联式容器底层是二叉树//打印函数void printMap(map<int, int&gt...

2020-04-29 10:21:44 104

原创 C++:STL之set

#include<iostream>#include<set>#include<string>using namespace std;//关联式容器,底层是二叉树,插入时自动排序//set不允许有重复的元素//multiset允许有重复的元素//遍历void printSet(set<int>&s){ for ...

2020-04-29 10:19:48 129

原创 C++:STL之list

#include<iostream>#include<list>using namespace std;//双向循环链表容器//迭代器只支持前移一位和后移一位,不能跳着访问//动态存储分配,不会造成内存浪费,删除插入方便只需改动指针//空间和时间耗费较大//打印函数void printList(list<int>&L){...

2020-04-29 10:15:49 165

原创 C++:STL之queue

#include<iostream>#include<queue>using namespace std;//队列容器,不能遍历,先进先出int main(){ //构造函数 queue<int>q1; //拷贝构造 queue<int>q2(q1); //=赋值 queue<int>q3 = q2; //...

2020-04-29 10:11:38 212

原创 C++:STL之stack

#include<iostream>#include<stack>using namespace std;//栈容器,不能遍历,先进后出int main(){ //默认构造 stack<int>stk1; //拷贝构造 stack<int>stk2(stk1); //赋值 stack<int>stk3 =...

2020-04-29 10:09:45 122

原创 C++:STL之deque容器

包含头文件#include<iostream>#include<deque>#include<algorithm>using namespace std;打印函数void printfDeque(const deque<int>&d){ for (deque<int>::const_iterator it = ...

2020-04-14 13:14:21 144

原创 C++:STL之Vector

头文件包含#include <iostream>#include <string>#include<vector>using namespace std;打印函数void printVector(vector<int>&v){ for (vector<int>::iterator it = v.begin(); ...

2020-04-13 20:31:20 143

原创 C++:STL之String容器

#include <iostream>#include <string>#include<vector>using namespace std;//string的构造函数,在string类型中中文占两个位置void test01(){ //默认构造string(); string s; cout << s << en...

2020-04-13 11:35:14 105

原创 C++:模板

#include <iostream>#include <string>using namespace std;//函数模板,有自动类型推导,也可以使用显式指定类型template<typename T>void fun(T &a, T &b){ T temp = a; a = b; b = temp;}template&...

2020-04-11 00:54:27 57

原创 C++:二进制文件

#include<iostream>#include<fstream>using namespace std;class Person{public: char m_Name[64]; int m_Age;};//二进制写文件,存入类void test01(){ //创建流对象 ofstream ofs; ofs.open("person....

2020-04-02 11:36:02 144

原创 C++:文本文件读写

必须包含头文件#include<fstream>三种方式 ifstream 读文件 ofstream 写文件 fstream 读写文件//创建流对象fstream iof;//iof对象名iof.open("路径名",打开方式);//关闭文件iof.close();#include<iostream>#include&lt...

2020-04-01 13:39:00 244

原创 C++:运算符重载(详)

#include <iostream>#include <string>using namespace std;class Num{ friend ostream& operator<<(ostream&, Num&); friend istream& operator>>(istream&, Nu...

2020-03-24 23:50:33 106

原创 C++学习笔记:利用虚函数面积计算

抽象基类Shape.h#pragma onceclass Shape{public: virtual void shapeName()const = 0; //定义两个纯虚函数 virtual void printArea()const = 0; //输出面积};圆形Circle.h#pragma once#include "Shape.h"#include&l...

2020-02-10 23:33:22 521

原创 C++学习笔记:运算符重载

Myclass.h#pragma once#include <iostream>using namespace std;class Myclass{public: Myclass(); Myclass(int value) : m_value(value) { } //重载+号运算符 const Myclass operator+(const Myclass &...

2020-01-29 12:41:43 272

原创 C++学习笔记:类

头文件student.h#pragma once#include <string>#include <iostream>using namespace std;class student{public: //公有的 student(); //构造函数 /* 重载构造函数 */ student(int,string,char); //构...

2020-01-26 12:01:13 172

原创 C++学习笔记:常对象

常对象数据成员只能通过构造函数的参数初始化表对常数据成员进行初始化,任何其他函数都不能对常数据成员赋值。如:const int hour;下面用法是非法的:Time::Time(int h){ hour=h;}因为常数据成员是不能被赋值的。常成员函数如果将成员函数声明为常成员函数,则只能引用本类中的数据成员,而不能修改它们。列如:void get_time()cons...

2020-01-23 14:22:06 231

原创 C++学习笔记:结构体的一些用法,以及通过结构体和指针搭建的单向静态链表。

#include <iostream>#include <Windows.h>#include <string>using namespace std;struct Date{ int year; int month; int day;};struct Student{ int num;//学号 string name;//姓名 i...

2020-01-18 20:44:57 202

原创 C++:指针的用法以及一些其他内容

#include <iostream>#include <Windows.h>#include <vector>#include <algorithm>using namespace std;int main(){ //指针 double num = 1024.5; double* ptr_num = &num; void...

2020-01-14 18:59:11 125

原创 C++:输入一句话,然后把这个字符串以单词为单位,逆转输出。

C++:输入一句话,然后把这个字符串以单词为单位,逆转输出。比如将“Alice call Jack”转换为“Jack call Alice”#include <iostream>#include <Windows.h>#include <string>using namespace std;int main(){ int i = 0, j = 0...

2020-01-10 20:42:49 2217 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除