
C++
CaptainHailong
爱生活,还学习!!!
展开
-
qt打包程序
qt打包程序 1. set up environment call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" 2.windeployqt 打包 windeployqt MonitorPlatfrom.exe原创 2020-07-13 10:17:26 · 8196 阅读 · 2 评论 -
C++ 获取大型文件大小
#include <iostream> #include <sys\stat.h> using namespace std; unsigned long long file_size( char * filename ) { unsigned long long size; struct __stat64 st;原创 2020-07-08 12:06:58 · 685 阅读 · 0 评论 -
C++ 字符串分割
C++ 字符串分割, //s为原始字符串,v为分割后的字符串数组,c为分割字符串如(,:,;) splitString(const std::string& s, std::vector<std::string>& v, const std::string& c) { std::string::size_type pos1, pos2; pos2 = s.find(c); pos1 = 0; while (std::string::np...原创 2020-07-02 21:23:52 · 8256 阅读 · 0 评论 -
C++遍历文件夹和子文件夹下的文件包括完整路径名
C++遍历文件夹和子文件夹下的文件包括完整路径名 网上总结的代码,最终输出所有文件的完整路径,包括子文件夹下的文件,在win7,vs2013测试通过,如果出现程序卡死的情况,有可能是文件夹是完全中文的。 #include "stdafx.h" #include <iostream> #include <io.h> #include <string&g...原创 2019-03-30 15:03:29 · 1605 阅读 · 1 评论 -
C++获取本地系统时间
C++获取本地系统时间 #include<iostream> #include<time.h> int main(){ time_t tt = time(NULL);//这句返回的只是一个时间戳 tm* t = localtime(&tt); std::cout<<"当前时间:"<<t->tm_year + 1900...原创 2019-03-30 19:32:35 · 2707 阅读 · 0 评论 -
MFC 选择文件
MFC选择文件夹中的文件,以视频文件为例 void openFile(){ string _Path; CFileDialog Openfiledlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, _T("Video Files (*.rmvb;*.avi;*.*)|*.rmvb;*.avi;*.*||")); ...原创 2019-03-30 19:36:27 · 1109 阅读 · 0 评论 -
c++ MFC选择文件夹
c++ MFC选择文件夹 void openDir(){ //选择文件夹 string _Path,root; TCHAR szDir[MAX_PATH]; BROWSEINFO bi; ITEMIDLIST *pidl; bi.hwndOwner = this->m_hWnd; bi.pidlRoot = NULL; bi.pszDisplayName = sz...原创 2019-03-30 19:39:17 · 1234 阅读 · 1 评论 -
C++ tchar转char,string
C++ tchar转char,string tchar2char void tchar2char(tchar* input,char* output){ int length = WideCharToMultiByte(CP_ACP, 0, input, -1, NULL, 0, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, input, ...原创 2019-03-30 19:44:41 · 9648 阅读 · 0 评论 -
ubuntu makefile 静态库的生成与调用,动态库的生成与调用
ubuntu makefile 静态库的生成与调用,动态库的生成与调用 准备工作 首先建立一个文件夹用以存放我们的文件 命令行下输入以下命令建立文件夹 mkdir Test cd Test 1.静态库的生成 新建一个文件夹,static用来存放静态库的数据,在static下新建include和src文件夹,在include文件夹下建立头文件static.h 内容如下: //st...原创 2019-04-11 19:55:30 · 1783 阅读 · 2 评论