自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(47)
  • 问答 (2)
  • 收藏
  • 关注

原创 UDTepoll

【代码】UDTepoll。

2022-12-14 22:30:01 119

原创 wifi断线重连

//WifiMgr.h#pragma once#include <windows.h>#include <wlanapi.h>#include <stdio.h>#include <iostream>#pragma comment(lib, "wlanapi.lib")//连接方式#define MODE_AUTO "auto"#define MODE_MANUAL "manual"//认证方式#define AUTH_WPAPSK

2022-03-25 23:48:47 274

原创 Windows 鼠标键盘钩子

设置钩子函数:SetWindowsHookEx(WH_MOUSE, HookMouseProce, NULL, GetCurrentThreadId());钩子的回调函数:LRESULT CALLBACK HookMouseProce(int nCode, WPARAM wParam, LPARAM lParam);钩子的取消函数:UnhookWindowsHookEx(g_hookmouse);DLL导出:extern “C” __declspec(dllexport) BOOL Insta

2021-10-17 11:56:24 344

原创 TCP 客户端发送文件到服务器

server.cpp#define _CRT_SECURE_NO_WARNINGS#define _WINSOCK_DEPRECATED_NO_WARNINGS#include <iostream>#include <stdio.h>#include <WinSock2.h>#include<string.h>#pragma comment(lib,"wsock32.lib")using namespace std;//缓存大小设置不能

2021-08-03 23:48:43 256

原创 UDP服务器判断客户端是否掉线

client.cpp#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include<stdlib.h>#include<string>#include<winsock.h>#pragma comment(lib,"ws2_32.lib")using namespace std;void getPub_ip(char *ip)//获取IP{ //system("curl -L ip.

2021-06-05 17:24:27 2349 1

原创 内存快速遍历(查找不断变小的数值)

#define _CRT_SECURE_NO_WARNINGS#include <windows.h>#include <stdio.h>#include <thread>#include<stdlib.h>#include<String.h>#include<time.h>#include<time.h>#include<math.h>#include<iostream>#inc

2021-05-23 21:38:46 517

原创 腾讯云配置mysql

配置mysql允许远程链接  #mysql -u root -pEnter password:……mysql>  mysql>update user set host = ‘%’ where user = ‘root’;mysql>select host, user from user;c++ 链接#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<Windows.h>#inc..

2021-04-20 19:30:42 462

原创 c++ 内存查找某个进程的某个值

内存查找进程的数字,功能实现了,但是速度慢,有待改进。CE为什么那么快?#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include <fstream>#include<windows.h>#include<tlhelp32.h>#include <string.h>using namespace std;#if defined(_MSC_VER)#define strca.

2021-03-18 16:58:02 719 1

原创 C++ 字符串相互转换

//LPCWSTR 转stringstring WCharToMByte(LPCWSTR lpcwszStr){ string str; DWORD dwMinSize = 0; LPSTR lpszStr = NULL; dwMinSize = WideCharToMultiByte(CP_OEMCP, NULL, lpcwszStr, -1, NULL, 0, NULL, FALSE); if (0 == dwMinSize) { return FALSE; } lpszStr

2021-03-04 23:15:18 132 1

原创 c++ 数字识别

// 数字识别.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include<stdio.h>#include<stdlib.h>#include<windows.h>#include<String.h>#include<time.h>#include <core.hpp> #include <highgui.hpp> #include <opencv2/high

2021-02-18 16:59:13 1400 2

原创 c++ Windows编程 字符串

#include <iostream>#include<cstdlib>#include<windows.h>#include<StrSafe.h>using namespace std;/*多字符(MultiChar)也就是ANSI编码的方式,而宽字符(WideChar)也就是Unicode编码的方式WCHAR Unicode字符PWSTR 指向Unicode字符串的指针PCWSTR 指向一个恒定的Unicode字符串的指针对应的ANS

2020-12-24 17:18:27 189 1

原创 c++ windows函数错误显示 getlasterror与formatemessage

#include<iostream>#include<Windows.h>#include <limits>#include<stdio.h>#include<locale.h>using namespace std;/*HANDLE CreateFile(LPCTSTR lpFileName, // 指向文件名的指针DWORD dwDesiredAccess, // 访问模式(写 / 读)如果为 GENERIC_R

2020-12-24 10:53:35 205 1

原创 c++window常见数据类型

Windows常见数据类型数值----------------------------(unsigned short)WORD:16位无符号整型 范围(0 65535)(unsigned long)DWORD:32字节无符号整型 范围(0 4294967295)(unsigned long)UINT:32字节无符号整型 范围(0 4294967295)(unsigned __int64)DWORD64:64字节无符号整型 范围(0 18446744073709551615)20位(int)INT

2020-12-23 14:18:48 285

原创 C++大数乘法

#include<iostream>#include<Cstdlib>#include<memory>#include<Cstring>using namespace std;#define MAX 1024/*计算2664乘以452526644525 10 30 30 20 5 4 12 12 8 2 10 30 30 20 58

2020-12-20 10:33:51 119 1

原创 C++ 通过查找按钮句柄激活另外程序按钮 窗口函数EnumchildWindow,EnableWindow,setwindowpos用法

#include<iostream>#include<cstring>#include<Windows.h>//注意程序要用管理员权限打开,否则如果要查找的程序窗口是用管理员权限打开的,什么也改变不了BOOL CALLBACK EnumChildProc(HWND hwndChild,LPARAM lparam)//遍历子窗口回调函数{ if (hwndChild == (HWND)strtol("006B0ECE", 0, 16))//找到需要激活的按

2020-12-15 17:13:34 959

原创 打开记事本,发送字符到记事本编辑窗口,ShellExecute、FindWindow、SendMessage函数

#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include<stdlib.h>#include<Windows.h>void main(){ //ShellExecute( //hWnd: HWND; {指定父窗口句柄} //Operation: PChar; {指定动作, 譬如: open、runas以管理员身份打开、print、edit、explore、find[2] } //FileNa

2020-12-10 10:11:15 392

原创 数据结构-文件处理

文件载入内存,生成链表实现查询,删除,修改student1.txt182544,陆一在,18911555661193752,孙训兰,18911555662197132,程昕,18911555663205844,王亚威,18911555664bdfunction.h#pragma once#include <stdio.h>#include<stdlib.h>#include"memfunction.h"//内存管理函数的头文件//定义链表结构(指针链表void

2020-11-26 13:50:51 214

原创 网络-TCP通信

server.cpp//warning C4996 : 'inet_ntoa' : Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings//这个错误关闭项目属性-c/c++里面的SDL检查#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include<

2020-11-26 10:24:19 77

原创 网络-UDP通信

server.cpp#include <stdio.h>#include<stdlib.h>#include<string.h>#include<winsock.h>#pragma comment(lib,"ws2_32.lib")void main(){ SOCKET server; char recstr[128]={0}; int reclen=0; int lenght; SOCKADDR_IN server_add;/

2020-11-20 23:05:53 46

原创 网络-c获取网站内容

#include<windows.h>#include<Wininet.h>#include<iostream>#include<fstream>#include<string>#include<locale.h>#pragma comment(lib,"WinInet.lib")using namespace std;string Utf8ToGbk(const char *src_str)//utf..

2020-11-17 23:22:53 194

原创 内存管理(采用链表)-malloc-free

memfunction.h#include<stdio.h>#include<stdlib.h>typedef struct MemoryNode //内存结构{ int size;//内存字节数 void *paddr;//内存地址}Mnode,*PMnode;typedef struct Memlist//双链表{ Mnode Mdata; Memlist * next;//链表下一个 Memlist * pre;//链表上一个}Mlist,*PM

2020-09-22 16:06:55 332

原创 C函数-管道-popen-pclose

#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>#include<string.h>//_popen _pclose用来开通和结束一个管道,管道的功能可以保存命令执行的结果到字符串或文件,可以用来判断程序执行的效果,结果int exeshell(char *cmd,char *result){ FILE *pf;//定义一个文件指针 /*r:调用进程可以使用返回的流读取

2020-09-21 15:41:19 117

原创 数据结构-排序-归并排序

#include<stdio.h>#include<stdlib.h>// 16 17 13 10 9 15 3 2 5 8 12 1 11 4 6 14void Merge(int * arr1, int * arr2, int head, int middle, int tail){ int t = middle+1; //int k=0;//arr2的坐标 此处的k不能为0,为0的话会覆盖之前已经比较过的 int k = head; for (; head.

2020-09-13 17:01:34 58

原创 数据结构-排序-shellsort希尔排序

#include<stdio.h>#include<stdlib.h>void show(int *arr,int sum){ for (int i = 0; i < sum; i++) printf("%d,", arr[i]); printf("\n");}//希尔排序void shellSorta(int * arr, int sum)//在插入排序的基础上增加一个增量,将增量的记录组成一个子序,再进行排序/*arr[10] = { 0,9,.

2020-08-25 18:01:20 129

原创 数据结构-排序-冒泡排序-快速排序-插入排序-堆排序

#include<stdio.h>#include<stdlib.h>void swap(int *a, int *b){ int temp = *a; *a = *b; *b = temp;}void show(int *arr,int sum){ for (int i = 0; i < sum; i++) printf("%d,", arr[i]); printf("\n");}void maopao(int *arr,int su.

2020-08-24 15:34:26 162

原创 数据结构-迷宫(采用迪杰斯算法)最短路径走出迷宫

main.cpp#include <stdio.h>#include <stdlib.h>#include "function.h"void main(){ int maze[ROW][COL] = { 0 }; InitMaze(maze);//初始化迷宫 DrawMaze(maze);//绘制迷宫 AImazeDijkistra(maze);//AI算法最短路径 system("pause");}function.h#include<s

2020-08-18 14:31:22 1336 2

原创 数据结构-迷宫

迷宫.cpp#include <stdio.h>#include <stdlib.h>#include "function.h"void main(){ int maze[10][10] = {0}; InitMaze(maze); DrawMaze(maze); AImaze(maze,0,0); if (maze[9][9] != 1) printf("此路不通\n"); else printf("走出来了\n"); //ControlMaz

2020-08-14 13:56:53 146

原创 数据结构-排序-平衡二叉排序树

双旋转的平衡因子的处理BalanceLiftRotate()函数1、先判断10的BL为-1,说明新增节点9在右边,这时直接左旋就可以如果10的BL为+1,说明新增节点9在左边,这时如果直接左旋,就不符合排序二叉树左小右大的规则,这时要进行双旋转操作。双旋之前要先重新处理平衡因子(BL)2、根据9的平衡因子,处理7,10节点的平衡因子如果9的平衡因子为0,则7,10的平衡因子设为0;如果9的平衡因子为1,则7的平衡因子为-1,10的平衡因子为0;如果9的平衡因子为-1,则7的平衡因子为0,10.

2020-08-06 11:41:14 299

原创 数据结构-查找-二分查找-插值查找-斐波那契查找

二分查找:对半比较,再对半比较,直到找到或找不到;插值查找:二分查找法的升级,根据查找的内容算出比率,取代二分之一。(效率最高)斐波那契查找:也是二分查找法为基础,但是比率是按斐波那契数列进行的。main.cpp#include<iostream>#include<stdio.h>#include <stdlib.h>#include<string>#include"structfun.h"using std::string;using

2020-07-31 09:57:47 128

原创 数据结构-图-有向无环图-关键路径查找

拓扑排序:0,2,5,1,3,4,6,7,8,9etv:顶点的最早发生时间ltv:顶点的最晚发生时间节点的etv=ltv,就是图的关键路径;1、计算etv[0-9] etv[0]的值为0;etv[2]的值为4;etv[5]的值为4+7=11;etv[1]的值为3;etv[3]的值为3+5=8与4+8=12之间选择,选择最大的为12;etv[4]的值为3+6=9与12+3=15之间选择,选择最大的为15;etv[6]的值为15+9=24;etv[7]的值为15+4=19与11+6=17之间选择,.

2020-07-27 16:13:31 321

原创 数据结构-图-拓扑排序算法

方法:采用邻接表数据结构,加入顶点入度in,定义一个栈,用于存储入度为零的顶点1、循环查找首次入度为零的顶点,入栈2、循环,出栈,打印栈顶,处理栈顶指向顶点的入度减一,减一后入度为零的顶点再入栈,直到栈为空推出循环。main.cpp#include<iostream>#include<stdio.h>#include <stdlib.h>#include<string>#include"structfun.h"using std::str

2020-07-24 11:49:18 424

原创 数据结构-图-最短路径-弗洛伊德算法(Floyd)

1.txtv0v1v2v3v4v5v6v7v80,1,10,2,51,2,31,3,71,4,52,4,12,5,73,4,23,6,34,5,34,6,64,7,95,7,56,7,26,8,77,8,40,0,0structfun.h//数据结构函数头文件#include <stdio.h>#include <iostream>#include<string>using std::cout;u..

2020-07-17 17:15:33 339

原创 数据结构-图-最短路径-迪杰斯特拉算法(Dijkistra)

分析:D数组存权重集合,F存访问标识,P存顶点,m最小权重,cur记录m的顶点。D【0,1,5,-,-,-,-,-,-】F【1,0,0,0,0,0,0,0,0】P【0,0,0,0,0,0,0,0,0】 m=1 cur=1在v0->v1最短路径的基础上,计算v1到其他相连的顶点,f[n]!=1的边;D【0,1,54 ,8,6,-,-,-,-】F【1,1,0,0,0,0,0,0,0】P【0,0,1,1,1,0,0,0,0】 m=4 cur=2在v0->v2最短路径的基础上,计算v..

2020-07-16 15:42:06 316

原创 数据结构-图-最小生成树-克鲁斯卡尔算法(Kruskal)边多的用prim,边少的用kruskal

思路:设置一个数组p[edgenum],存放访问过的边,设置一个边集数组结构,存放边的begin,end,weight.把所有边放入边集数组,并按权重从小到大排序。n为p的下标 m为p的值1:权重 7 输出 h e(7 4) 数组p(000070000) n=4 m=72:权重8 输出 i c (8 2) p(008070000) n=2 m=83:权重10输出 ba (1 0) p(108070000) n=0 m=14:权重11输出 fa ..

2020-07-07 15:04:25 185

原创 数据结构-图-最小生成路径-prim算法

思路:一、从A开始 A->B 10,A->F 11 输出A->B;二、A->F 11 ,B->F18 , B->I 12 ,B->G16 输出A->F;三、BC 18 BI 12 BG 16 FG 17 FE 26 输出BI 12;四、BC 18 BG 16 FG 17 FE 26 IC 8 ID 21输出IC 8;五、BC 18 BG 16 FG 17 FE 26 ID 21 CD 22 输出BG16;六、FE26 ID 21 CD 22 ..

2020-07-06 14:10:57 219

原创 数据结构-图的深度遍历和广度遍历-邻接矩阵-邻接表

structfun.h//数据结构函数头文件#include <stdio.h>#include <iostream>#include<string>using std::cout;using std::cin;using std::string;#define MAXSIZE 100#define OK 1#define ERROR 0#define INFINITY 65535//无穷大typedef string ElemType;.

2020-07-02 09:53:49 913

原创 数据结构-图的4种结构-邻接矩阵-邻接表-十字链表-邻接多重链表

边节点数据结构:iver,ilink,jver,jlink创建边节点时,查找iver,jver对应下标开始最后ilink,jlink为空时,把ilink或jlink指向当前所创建的节点。顶点的edgefrist指针为空时表示创建的边节点为该顶点的第一条边。edgefirst直接指向该节点。structfun.h//数据结构函数头文件#include <stdio.h>#include <iostream>#include<string>using s.

2020-06-25 15:13:05 312

原创 数据结构-树-哈夫曼树-哈夫曼编码

structfun.h//数据结构函数头文件#include <stdio.h>#include <iostream>#include<string>using std::cout;using std::cin;using std::string;#define MAXSIZE 200#define OK 1#define ERROR 0typedef string ElemType;//4->二叉链表存储结构(二叉链表存储结构跟树

2020-06-21 17:51:45 183

原创 数据结构-树-二叉链表-前序遍历-中序遍历-后序遍历

structfun.h//数据结构函数头文件#include <stdio.h>#include <iostream>#include<string>using std::cout;using std::cin;using std::string;#define MAXSIZE 200#define OK 1#define ERROR 0typedef string ElemType;//二叉链表存储结构(二叉链表存储结构跟树的孩子兄弟表

2020-06-19 14:05:13 624

原创 数据结构-树的前序-中序-后序线索化及遍历

structfun.h//数据结构函数头文件#include <stdio.h>#include <iostream>#include<string>using std::cout;using std::cin;using std::string;#define MAXSIZE 200#define OK 1#define ERROR 0typedef string ElemType;//5->线索二叉树存储结构typedef e

2020-06-19 13:46:22 165

空空如也

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

TA关注的人

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