![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
编程
文章平均质量分 51
一堆土
图像处理学习的小渣渣
展开
-
VS2017优化
将VS中的配置属性,其中C/C++设置中的优化选项,更改其中的选项,确实可以提升程序的性能。对比禁用和最大优化两个选项得到的数据:2022/4/18 393.0000002022/4/18 397.0000002022/4/18 399.0000002022/4/18 127.0000002022/4/18 132.0000002022/4/18 134.000000可见性能提升了很多,耗时时间缩小了一半以上。 MeshToolKit meshToolkit; meshT..原创 2022-04-19 08:57:38 · 992 阅读 · 0 评论 -
C++11 多线程-std::condition_variable
#include <iostream>#include <thread>#include <condition_variable>#include <queue>std::mutex mtx;std::condition_variable cv;int signal_sym = 0;struct MySturuct{ int a;};std::queue<MySturuct>;void PrintString_1().原创 2021-10-11 16:46:00 · 146 阅读 · 0 评论 -
C++ txt文件输出
#include <iostream>#include <fstream>class PrintInfo{public: PrintInfo(const char *i_Path); ~PrintInfo(); void GetInfo(const char *i_Info); void ExcutPrint(); void EndPrint();private: std::ofstream m_outInfo; std::string m_Pa.原创 2021-09-09 17:08:22 · 490 阅读 · 0 评论 -
获取用户名
在windows平台下,使用GetUserName获取当前用户名,使用GetComputerName获取当前计算机名;#include <iostream>#include <windows.h>#include <cstring>#include <string>#include "lm.h"#pragma comment(lib,"netapi32.lib")using namespace std;// 多字节转strings原创 2021-08-19 20:28:15 · 504 阅读 · 0 评论 -
MFC 类中添加数据库链接sql 生成对应的类
在对话框界面中,右键类向导中,添加类(MFC ODBC使用者);点击数据源选择机器数据单击需要链接的数据库:点击 完成,自动生成与数据库对应的类;然后修改一下出错的行,即可生成数据库相同数据的类...原创 2020-02-26 19:02:47 · 280 阅读 · 0 评论 -
mfc 界面中使用控件(button)
CRect m_reLogin, rcExit;m_Login.GetWindowRect(&m_reLogin);m_exit.GetWindowRect(&rcExit);CPoint point;// 获取鼠标点GetCursorPos(&point);// 判断鼠标点是否在控件上if (m_reLogin.PtInRect(point))对于M...原创 2020-02-23 16:05:01 · 695 阅读 · 0 评论 -
MFC-VS2013-报错处理
解决编译器编译问题,在预处理或者代码cpp中添加_CRT_NONSTDC_NO_DEPRECATE_CRT_SECURE_NO_WARNINGSmark一个可能会遇到的问题,windows.h和winsock2.h有类型重定义,头文件互相包含https://www.cnblogs.com/justkong/p/4776135.html...原创 2019-10-20 10:04:40 · 228 阅读 · 0 评论 -
使用windows API复制文件到指定目录
不知道为啥,在string后面必须要加'\0';不然,有的 复制成功,有的 复制失败stringsFrom=currTemplatePart->GetPartPath()+currTemplatePart->GetpPartMain()->GetPartName();sFrom+="\\*.*";sFrom+='\0';iDirection+...原创 2019-09-19 21:51:15 · 1115 阅读 · 0 评论 -
C++遍历文件夹名
char newpath[200]; strcpy(newpath, path); strcat(newpath, "\\*"); // 在目录后面加上"\\*.*"进行第一次搜索 int handle; _finddata_t findData; handle = _findfirst(newpath, &findData); if (handle == -1) ...原创 2019-09-03 18:47:11 · 228 阅读 · 0 评论 -
C字符串数组
在C语言中,定义一个字符串数组比较麻烦,需要给每个字符串分配内存大小! size_t countLines = castWeightInfo.size() + steelWeightInfo.size() + 5; char **sWeightInfor = (char **)FNX_MEM_malloc(sizeof(char*)*countLines); for (int ...原创 2019-07-15 16:35:13 · 554 阅读 · 0 评论 -
C/C++重载
重载规则与调用匹配重载规则:1,函数名相同;2,参数个数不同,参数的类型不同,参数顺序不同,均可构成重载。3,返回值类型不同则不可以构成重载。void func(int a); //okvoid func(char a); //okvoid func(char a,int b); //okvoid func(int a,char b); //ok...原创 2018-12-08 13:18:38 · 586 阅读 · 0 评论 -
vector的使用
vector常用方法assign() 对Vector中的元素赋值void assign( input_iterator start, input_iterator end ); //void assign( size_type num, const TYPE &val );reserve() 设置Vector最小的元素容纳数量 函数为当前vector预留至少共容转载 2017-07-23 09:11:34 · 481 阅读 · 0 评论 -
C及C++基础学习
系统的C++学习路线:原创 2017-09-27 14:31:48 · 726 阅读 · 0 评论 -
大端小端
大端小端原创 2017-09-30 15:52:22 · 269 阅读 · 0 评论 -
C/C++ 函数指针
函数指针原创 2017-10-14 20:04:45 · 256 阅读 · 0 评论 -
C++代码学习
#include<iostream>#include<cmath>using namespace std;class point{public:point(int x = 0, int y = 0) :x(x), y(y) { count++; }point(point&p) { x = p.x; y = p.y; count++; ...原创 2018-05-12 09:38:08 · 539 阅读 · 0 评论 -
TCHAR char CString string整理
TCHAR是一种字符串类型,是在以MBCS和UNICODE来build程序时可以使用同样的代码,不需要使用繁琐的宏定义来包含你的代码,而char代表ASCII的字符。UNICODE是以两个字节方式存储,ASCII是一个字节的方式存储。#ifdef UNICODEtypedef wchar_t TCHAR;#elsetypedef char TCHAR;#endif所以用MBCS来bui...原创 2018-10-31 22:46:54 · 557 阅读 · 0 评论 -
malloc申请最大运行内存
贴一个在Windows平台下,关于malloc申请最大运行内存的代码,运行很费时间,可能是一个byte去读,效率比较低吧。#include<stdio.h>#include<stdlib.h>unsigned maximum = 0;int main(){ unsigned blocksize[] = { 1024 * 1024, 1024, 1 };...原创 2018-11-17 20:06:27 · 2682 阅读 · 0 评论 -
C/C++遍历文件和目录
C/C++遍历文件夹的数目原创 2017-08-28 22:04:41 · 527 阅读 · 0 评论