摘要: map遍历删除 vector遍历删除 阅读全文
posted @ 2016-12-21 15:32 风的哀伤 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 1 #pragma once 2 #include "stdafx.h" 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 10 bool badvalue(int x) 11 { 12 if (x == 1 || x==2) 13 return tru... 阅读全文
posted @ 2016-12-21 15:28 风的哀伤 阅读(1786) 评论(0) 推荐(0) 编辑
摘要: 1 HANDLE handle; //定义文件句柄 2 char buffer[100]; //定义缓冲区 3 int i; //接收实际操作的字节数 4 CString str; //定义字符串变量 5 handle = ::CreateFile("C:\例子.txt", 0,FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRIT... 阅读全文
posted @ 2016-12-20 14:59 风的哀伤 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 在Winsock中提供了几个关于网络字节顺序与主机字节顺序之间的转换函数。函数定义如下: 1 //将一个u_short类型的IP地址从主机字节顺序转换到网络字节顺序 2 • u_short htons (u_short hostshort ); 3 • //将一个u_long类型的IP地址从主机字节 阅读全文
posted @ 2016-12-16 11:11 风的哀伤 阅读(339) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #define BUFF_SIZE 1024 wchar_t * ANSIToUnicode( const char* str ) { int textlen ; wchar_t * result; textlen = MultiByteToWideChar( CP_ACP, 0, st... 阅读全文
posted @ 2016-11-25 14:06 风的哀伤 阅读(2887) 评论(0) 推荐(0) 编辑
摘要: 获得可执行文件所在路径的文件夹1 CString sText;2 TCHAR szPath[MAX_PATH];3 ZeroMemory(szPath, sizeof(TCHAR)*MAX_PATH);4 GetModuleFileName(NULL, szPath, sizeof(TCHAR... 阅读全文
posted @ 2015-02-10 18:32 风的哀伤 阅读(586) 评论(0) 推荐(0) 编辑
摘要: Delphi 打开串口与关闭串口 1 procedure TForm1.btn1Click(Sender: TObject); 2 begin 3 cm1.CommName:=cbb1.Text; 4 cm1.BaudRate:=strtoint(cbb2.Items[cbb2.ItemIn... 阅读全文
posted @ 2013-07-31 15:25 风的哀伤 阅读(696) 评论(0) 推荐(0) 编辑