大约有 16,000 项符合查询结果(耗时:0.0179秒) [XML]
std::find,std::find_if使用小结 - C/C++ - 清泛网 - 专注C/C++及内核技术
...用std::find(),例如:
#include <vector>
#include <algorithm>
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
std::vector<std::string> vec;
vec.push_back("one");
vec.push_back("two");
vec.push_back("three");
//查找
std::vector<std::string>::iterator it = std::find(vec....
mfc 画圆角矩形 - C/C++ - 清泛网 - 专注C/C++及内核技术
...Background );
return TRUE;
}
调用方法:
void CxxxView::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(S...
vc/mfc *通配符 批量删除文件 - C/C++ - 清泛网 - 专注C/C++及内核技术
...效,使用SHFileOperation函数:#include "stdafx.h"#include <windows.h>int _tmain(int argc, _TCHAR*...直接上代码,可直接运行亲测有效,使用SHFileOperation函数:
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
LPTSTR delFileName...
控件不响应OWNERDRAW消息 - C/C++ - 清泛网 - 专注C/C++及内核技术
控件不响应OWNERDRAW消息afx_msg voidOnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);void COrderPaneDlg::OnDrawItem(int nIDCtl, LPDRAWITEM...afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
void COrderPaneDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemS...
mfc 如何隐藏滚动条 - C/C++ - 清泛网 - 专注C/C++及内核技术
mfc 如何隐藏滚动条void Cxxx::OnSize(UINT nType, int cx, int cy){ ... ShowScrollBar(SB_BOTH, FALSE); ...}简单粗暴,最实用,亲测有效。void Cxxx::OnSize(UINT nType, int cx, int cy)
{
...
ShowScrollBar(SB_BOTH, FALSE);
...
}
简单粗暴,最实用,...
[源码实例] c/c++获取网卡mac地址 - C/C++ - 清泛网 - 专注C/C++及内核技术
... NameBuff [30];
}ASTAT, * PASTAT;
ASTAT Adapter;
void getmac_one (int lana_num,char *pMicID)
{
NCB ncb;
UCHAR uRetCode;
memset( &ncb, 0, sizeof(ncb) );
ncb.ncb_command = NCBRESET;
ncb.ncb_lana_num = lana_num; // 指定网卡号
// 首先对选定的网卡发送一个NC...
error C2512: “Foo”: 没有合适的默认构造函数可用 - C/C++ - 清泛网 - 专...
...g namespace std;
//顺序容器举例
class Foo
{
public:
Foo(int i):ival(i){}
private:
int ival;
};
int main(int argc, char *argv[])
{
vector<Foo> empty;
vector<Foo> bad(10);
vector<Foo> ok(10,1);
return 0;
}
解决办法: 实际上根据c++ primer第...
passing xxx as \'this\' argument of xxx discards qualifiers - C/C++ - 清泛网 - 专注C/C++及内核技术
...#include <set>
using namespace std;
class StudentT {
public:
int id;
string name;
public:
StudentT(int _id, string _name) : id(_id), name(_name) {
}
int getId() { // 应该声明为const成员
return id;
}
string getName() { // 应该声明...
MFC 时间控件CDataTimeCtrl使用(获取日期、时间字符串等) - C/C++ - 清泛...
... m_date;
( (CDateTimeCtrl*)GetDlgItem(IDC_StartDate) )->GetTime(m_date);
int year1 = m_date.GetYear();
int month1 = m_date.GetMonth();
int day1 = m_date.GetDay();
( (CDateTimeCtrl*)GetDlgItem(IDC_StartHour) )->GetTime(m_date);
int hour1 = m_date.GetHour();
然后可以按照规定的格式...
memcpy() 是非线程安全的,并发时需加锁或使用原子操作 - C/C++ - 清泛网 -...
...子操作memcpy_thread_unsafe最近调查线上一个问题,就是一块 int32 的内存会极低概率出现 -18亿的巨数字,有时又是正确的。自己刻意测试又不能再现,在确认不可能将这样一个巨量数字写入的情况下,这时只 最近调查线上一个问...
