C/C++
文章平均质量分 82
我爱大家369
无志者自感千难万难,有志者自有千计百计!
专注开发,兼顾实施上线,不了解客户第一线那是闭门造车!
展开
-
Makefile详解
makefile详解大全原创 2022-10-12 22:01:21 · 521 阅读 · 0 评论 -
linux下《UNIX环境高级编程》(apue2)源码编译出错的处理方法
linux下《UNIX环境高级编程》(apue2)源码编译出错的处理方法原创 2022-10-12 21:56:53 · 189 阅读 · 0 评论 -
C++字节对齐与结构体大小
c++中关于结构体长度的计算问题原创 2022-10-12 21:54:42 · 89 阅读 · 0 评论 -
VC读取Access数据库三种方法。
CString GetCurrentPath(){CString sPath;GetModuleFileName(NULL,sPath.GetBufferSetLength (MAX_PATH+1),MAX_PATH);sPath.ReleaseBuffer ();char a = '\\';int nPos=sPath.ReverseFind(a);sPa原创 2015-03-29 16:44:23 · 3986 阅读 · 1 评论 -
QT Windows下进程间通讯(解决linux下管道失效问题)
/mTh = new ReciveDataThread(); //connect(mTh, &ReciveDataThread::receivedCommand, this, &MainWindow::slot_readDataFromServer); //mTh->start(); //filein.open(stdin, QFile::ReadOnly); //if (!filein.isOpen()) //{原创 2022-07-03 14:38:40 · 445 阅读 · 0 评论 -
进制转换
#include "stdafx.h"#include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ int n16 = 0x0500;//转为16进制 cout cout int n8 = 010010;//转为8进制 cout原创 2016-04-26 23:39:50 · 346 阅读 · 0 评论 -
MFC CListCtrl使用技巧
以下未经说明,listctrl默认view 风格为reportCListCtrl 风格LVS_ICON: 为每个item显示大图标 LVS_SMALLICON: 为每个item显示小图标 LVS_LIST: 显示一列带有小图标的item LVS_REPORT: 显示item详细资料直观的理解:windows资源管理器,“查看”标签下的“大图标,小图标,列表,详细资料”设置lis转载 2015-09-25 10:15:52 · 735 阅读 · 0 评论 -
c++与webserver通讯总结
gsoap生产的代理类; 在linux下编译; 代理类中有日志开关调试; 查看对方返回的报文格式,与wsdl的标准格式是否一致; 若取的值为空检查命名空间是否缺失; 注意应答超时时间;原创 2015-08-21 09:33:58 · 1916 阅读 · 0 评论 -
linux c++下gb18030、utf8之间的转换
int CHostFunc::ConverCode( const char * fromCode, //源字符编码名(gb18030、utf8等) const char * toCode, //目标字符编码名(gb18030、utf8等)原创 2015-08-21 09:43:40 · 5824 阅读 · 1 评论 -
接口函数开发总结
复杂接口函数总结: 1.注意入参检查,出参和返回值要明确返回; 2.注意打印日志,进入函数 打印,异常打印,结束函数打印;原创 2015-08-21 10:29:20 · 1066 阅读 · 0 评论 -
判断一个文件是否存在
bool QFile::IsFileExist(const CString& filename) { if ( _taccess((LPCTSTR)filename, 0) == -1 ) { //文件不存在 return false; } return true; }原创 2015-09-25 10:14:29 · 548 阅读 · 0 评论 -
VC 常见问题百问
(1) 如何通过代码获得应用程序主窗口的 指针? 主窗口的 指针保存在CWinThread::m_pMainWnd中,调用AfxGetMainWnd实现。 AfxGetMainWnd() ->ShowWindow(SW_SHOWMAXMIZED) //使程序最大化.(2) 确定应用程序的路径 Use GetModuleFileName 获得应用程序的路径,然后去掉可执行文件名。 Examp转载 2015-09-25 10:13:10 · 1324 阅读 · 0 评论 -
stl string截空格,替换字符串
void MyTrim(std::string &s) { if (s.empty()) { return ; } s.erase(0,s.find_first_not_of(” “)); s.erase(s.find_last_not_of(” “) + 1); }string& replace_all(string&原创 2015-08-21 09:40:07 · 2318 阅读 · 2 评论 -
截取字符串中的子串
在拼sql查询语句时,经常有where条件,有两种方法:1.select * from dual where 1=1 条件1: (and a = 123)条件2: ( and b = 456)这种拼接where条件时最好。2. select * from dual where 条件1: (a =123 and) 条件2:(b = 45原创 2015-04-19 21:28:45 · 767 阅读 · 0 评论 -
vc获取执行文件的目录
CString GetCurrentPath(){CString sPath;GetModuleFileName(NULL,sPath.GetBufferSetLength (MAX_PATH+1),MAX_PATH);sPath.ReleaseBuffer ();char a = '\\';------------------>\\注意转义符int nPos=原创 2015-03-29 16:42:21 · 636 阅读 · 0 评论