
C/C++
奥雷连诺
这个作者很懒,什么都没留下…
展开
-
tinyxml汉字乱码,UTF8转GBK
在解析读取tinyxml时候,发现读取汉字都是乱码,所以需要转成GBK static wstring ConvertUTF8toGBK(const char * strUTF8) { int len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)strUTF8, -1, NULL,0); TCHAR * wszUtf8 = new TC原创 2013-03-31 15:45:19 · 2476 阅读 · 1 评论 -
C语言格式化输出,空位补0,空位补空格
char strTtimeDump[512] = ""; int a = 5; sprintf(strTtimeDump, "%.4d", a); //strTtimeDump输出0005 数字前补3个0 sprintf(strTtimeDump, "%4d", a); //strTtimeDump输出 5 数字前补3个空格原创 2013-10-09 11:27:39 · 27406 阅读 · 0 评论 -
GBK转utf-8,宽字符转窄字符
//GBK转UTF8string CAppString::GBKToUTF8(const string & strGBK) { string strOutUTF8 = ""; WCHAR * str1; int n = MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, NULL, 0); str1 = new原创 2013-10-16 16:12:03 · 955 阅读 · 0 评论 -
使用wininet向FTP服务器发送文件
.h#pragma once#include #include #include #include using namespace std;class WininetFtpClient{public: WininetFtpClient(void); ~WininetFtpClient(void);public: bool ConncetServe原创 2013-11-01 14:17:07 · 697 阅读 · 0 评论 -
选择法排序,冒泡排序,递归排序
#include //选择排序void SelectSort(int *p, const int length){ if (p == NULL) { return; } for (int i = 0; i<length; i++) { int k = i; //记原创 2013-10-08 14:11:07 · 1089 阅读 · 0 评论 -
CreateEvent,OpenEvent成功后 是否需要::CloseHandle(xxx); 避免句柄泄漏
bool bExist = false; HANDLE hHandle = ::CreateEvent(NULL, FALSE, FALSE, L"Global\\xxxxx_name");if (hHandle && ERROR_ALREADY_EXISTS == GetLastError()){bExist = true;::OutputDebu原创 2015-01-29 11:00:57 · 4231 阅读 · 0 评论