![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
文章平均质量分 75
ingor
这个作者很懒,什么都没留下…
展开
-
浅谈vector、deque与list
大家都知道,在stl的container中,基础的container 可以分为两类(1)Sequence containers它包括 vector、deque、list;(2)Associative containers 包括set、multiset、map、multimap。这些容器都有许多相似的地方,但每个容器也都有自己的特点。下面我就浅谈一下vector、deque、list之间的相似与不同原创 2007-01-10 20:36:00 · 1643 阅读 · 0 评论 -
zip function
struct CAddInfo{ CAddInfo(){} CAddInfo(const CString& szName, DWORD iSize, bool bDir = false) :m_szName(szName), m_iSize(iSize), m_bDir(bDir){} CString m_szName;原创 2010-01-03 12:24:00 · 847 阅读 · 2 评论 -
软件设计之实现之一
写这篇文章,源于工作中自己的成长和一点一滴的总结。因为这是心血来潮的第一篇,所以首先介绍一下开发背景,这里是以面向对象开发语言为主,当然不局限于C++。本文希望对于如下人群有所帮助:1. 刚刚步入软件开发行业,并且热衷于面向对象编程的朋友共勉! 为了阐述C++例子,这里列举一个虚拟原创 2009-11-11 23:03:00 · 876 阅读 · 1 评论 -
CTreeCtrl的一个小技巧
前两天从网上(http://www.techsoft.no/bendik/)下载了一个CTreeCtrl得一个继承类,可以实现多选功能,不过有一个小问题,就是多选右键弹出菜单后,多选的的item显示出了问题:对着其中的一个selected item右键,会发现最后选中的那个item的选中状态(蓝色背景)没有了,感觉很奇怪,并且发现该项还在选中的列表中。于是跟踪一下(一上午)。发现了一个小窍门可以解原创 2009-08-04 17:34:00 · 1303 阅读 · 0 评论 -
放一个高手写的geometry lib
// gemotry.h/*Copyright (c) 2000-2002, Jelle Kok, University of AmsterdamAll rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided原创 2009-07-21 08:13:00 · 1669 阅读 · 0 评论 -
ingor-----forwarder-receiver(primary)
//forwarder-recevier.h#pragma once// 设计模式: 转发器--接收器(Forwarder--Receiver)//messageclass Message{public: Message(); Message(string strSender, string strData); ~Message();private: string m_strSen原创 2008-12-28 22:22:00 · 1017 阅读 · 0 评论 -
装饰模式小例
#include "stdafx.h"#include "decretor.h"#include using namespace std;void Test_Decorate(){ auto_ptr pComponent(new CreateComponentA); auto_ptr pDecorate(new BeforeDecorate); auto_ptr pDecorate2原创 2008-10-14 21:24:00 · 680 阅读 · 1 评论 -
盗窃虚表指针
今天,跟公司的人讨论了一个问题,感觉收益颇丰,故记录下来,以备后用。问题的大致跟虚表有关,这里的问题主要是利用小技巧窃取虚表指针,达到另类的hook。 #include "stdafx.h"#include using namespace std; class A{public: virtual void f() {原创 2008-08-04 23:21:00 · 664 阅读 · 0 评论 -
一个简单的Traits进阶过程
设计一个模板函数,用来求和。并且用Traits机制一步一步完善://traits/accum1.h#ifndef ACCUM_H#define ACCUM_Htemplate inlineT accum(T const* beg, T const* end){ T total = T(); while(beg != end){ total +=*beg; ++beg; } return t原创 2008-02-18 22:50:00 · 685 阅读 · 0 评论 -
备录
CPoint CDrawtestView::fun( CPoint ptCenter, int iRadius, int iInterval ,int idirect ,int iFlag){ if( iFlag ==-1) { int Temp = ptCenter.x; ptCenter.x = ptCenter.y; ptCenter.y = Temp; } for(int i = 1原创 2007-11-21 00:33:00 · 722 阅读 · 0 评论 -
关于extend neighbor
CPoint CDrawtestView::fun( CPoint ptCenter, int iRadius, int iInterval ){ for(int i = 1; true; i++) { double iTempRadius = iRadius * i;//y de cha ju do原创 2007-11-19 07:53:00 · 660 阅读 · 0 评论 -
关于CTreeCtrl上添加CToolTipCtrl
class CTreeCtrlhAssiant{public: static void AddNode(CMyToolTipCtrl& treeCtrl) { treeCtrl.m_pToolTipCtrl = new CToolTipCtrl; if (!treeCtrl.m_pToolTipCtrl->Create( &treeCtrl, TTS_ALWAYSTIP)) { TRAC原创 2008-01-24 01:29:00 · 819 阅读 · 0 评论 -
C++中的function object
看过了funciton object中的部分内容,感觉这些技术、 概念等真的需要慢慢体会,才能感受到它的博大精深。看下面的这个例子: #include #include #include using namespace std; void printInt (int elem) { cout } int main() {原创 2007-01-08 20:43:00 · 1210 阅读 · 1 评论 -
flex词法分析器的一个例子
flex词法分析器的一个例子原创 2010-08-20 23:45:00 · 3667 阅读 · 2 评论