- 博客(13)
- 资源 (21)
- 收藏
- 关注
转载 使用MFC 发送消息模拟按钮按下事件
<br />有时我们需要这么做, 手动模拟按钮按下的事件, 让程序做出与按钮真的按下时一样的响应. 设按钮ID为ID_BTN_OK, 当前Dialog窗口. 实际上系统并不能区分按钮是真的按下了(如用鼠标点击), 还是一个我们自己用代码模拟出的一种"假象".它所需要知道的只是哪个窗口(按钮也是一种窗口)发生了哪一种事件, 然后在消息循环中处理它. 系统怎么才能知道这些呢? 当然靠的是消息(message), 我们只需按照Windows或者MFC的标准格式把相应的信息传给系统,系统就会"上当"了.
2011-03-24 17:53:00 4068 3
原创 2011年3月24日——学习笔记
<br />1、容器和容器适配器有什么区别和联系,为什么容器适配器模板要提供两个类型,这两个类型各代表什么?<br />容器vector,list,deuqe是C++STL中三种基本容器实现,它们不可能互为实现同时又不损失效率, 就像颜色中的三原色红绿蓝可以混成其他多种颜色.而stack和queue则都可以在这三种基本容器序列基础上高效实现, 所以没有定义为独立的容器,而只作为基本容器适配器.所以容器适配器所提供的是原来容器的一个受限的界面, 特别是适配器不提供迭代器. 所有stack和queue是
2011-03-24 17:49:00 700
转载 微软、谷歌、百度等公司经典面试100题[第1-60题]——自己的实现
题目来源自http://blog.csdn.net/v_JULY_v/archive/2011/03/09/6234496.aspx1、有一个整数数组,请求出两两之差绝对值最小的值,记住,只要得出最小值即可,不需要求出是哪两个数#include #include #include #include using namespace std;/************************************************************************/
2011-03-14 13:18:00 1987
原创 代理类(C++沉思录)
<br />http://hi.baidu.com/cndx100/blog/item/e009cd46e3a9650f6a63e5e4.html<br />http://hi.baidu.com/gylxue/blog/item/598d62fa0f1064d5b48f318d.html<br />#include "stdafx.h"#include <iostream>using namespace std;//表示交通工具的派生类class Vehicle{public:
2011-03-11 21:39:00 681
原创 3月10学习笔记
<br />1、关于stl<br />#include <iostream>#include <vector>#include <iterator>#include <algorithm>#include <functional>using namespace std;class GT_cls{public: GT_cls(int val) : value(val) {} bool operator() (int other) {
2011-03-10 18:00:00 694
原创 通过引用计数实现智能指针(C++ Primer)
<br />#include <iostream>using namespace std;/************************************************************************//* 目的:通过引用计数实现智能指针 *//*********************************************************************
2011-03-10 10:03:00 2414 1
原创 精确统计程序运行时间
<br />#include <time.h>LARGE_INTEGER startCount;LARGE_INTEGER endCount;LARGE_INTEGER freq;QueryPerformanceFrequency(&freq);QueryPerformanceCounter(&startCount);QueryPerformanceCounter(&endCount);double elapsed = (double)(endCount.QuadPart -
2011-03-09 13:13:00 920
原创 求数组里面第二大的数
<br />#include <iostream>#include <iterator>using namespace std;/* 函数功能:查找数组中第二大数(要注意判断条件),该函数返回第二大数在数组中的下标*/int GetSecondMaxInArray(int arr[], int length){ if(1 == length) return -1; //表示无第二大值 else if(2 == length)
2011-03-08 14:44:00 1088
原创 二叉树的中序、后序、前序的递归与非递归输出
<br />#include "stdafx.h"#include <iostream>#include <cassert>#include <stack>using namespace std;typedef struct TreeNode{ char element; TreeNode* left; TreeNode* right; TreeNode(char ele, TreeNode* lchild = NULL, TreeNode*
2011-03-07 18:22:00 1141
原创 请编写一个程序,实现将树转化成二叉树。(华为)
#include "stdafx.h"#include #include using namespace std;//树的节点struct TreeNode{ char element; int childNumbers;//孩子结点的个数 struct TreeNode* child[3];//孩子的数组 TreeNode(){} TreeNode(char ele, int numbers) { element = ele; childNumb
2011-03-07 16:16:00 9121
原创 一道处理字符串的面试题
编写如下形式的字符串处理函数,要求将S1指向的字符串倒向复制给S2,如*S1 = "hello",则使 *S2 = "olleh"。且不能使用除S1,和S2以外的其余任何变量。还不能使用任何strlen等库函数。void ReverseStr( const char* s1 ,char* s2);#include using namespace std;void ReverseStr(const char *src, char *dst){ if(*src != '/0') //若sr
2011-03-07 13:21:00 1032 1
原创 学习笔记——3月4日
<br />1、基类指针指向派生类对象和派生类指针指向基类对象<br />#include <iostream>using namespace std;class Base{public: virtual void f1() { cout<<"Base::f1()"<<endl; } void f2() { cout<<"Base::f1()"<<endl; }};class Derived : public Base{public:
2011-03-04 12:04:00 602
原创 学习笔记——3月4日
1、基类指针指向派生类对象和派生类指针指向基类对象#include using namespace std;class Base{public: virtual void f1() { coutf1(); p1->f2(); //派生类指针指向基类 Derived *p2 = (Deri
2011-03-04 12:04:00 708
信用评分模型技术与应用——陈建
2018-01-31
灰度直方图匹配算法VC++
2009-10-31
电信系统设计文档(非常详细).rar
2009-10-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人