自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 资源 (1)
  • 收藏
  • 关注

原创 传说中的 The C++ Roadmap

来源于浙大bbs cc98编程技术版。

2009-07-22 09:54:00 1270

原创 深入理解sizeof

sizeof和strlen的详细区别在该文中(http://www.vckbase.com/document/viewdoc/?id=1054)有详细介绍,不再赘述,很大程度上都是依赖于编译器的实现。前者是一个operator,在编译时期确定;而后者是一个字符串函数,在运行时期确定。 因此sizeof(i++)之后,i是不改变原先的值的。  int i1; i1 =

2009-05-30 15:27:00 920 1

原创 关于数组的初始化

一般来说,数组的初始化有多种方略: 如果将其定义成全局性的,则会自动用缺省值初始化。如果成员数目较少,可以在定义时{}初始化,如果内含的初始值小于数组的定义元素个数,则其他的会自动赋值缺省值。 否则,需要自己初始化时:1. 可以用循环做2. memset,但是注意该函数是基于byte by byte的,因此对于非char型数组,初始化值非0时不可以用。3. stl::f

2009-04-08 23:20:00 828

原创 devenv.exe 进程莫名其妙占用CPU100%

        现有的VC的版本有VC6,VC7.0(vs2002),VC7.1(vs2003),VC8.0(vs2005),VC9.0(vs2008)。在开启主开发界面时,都会启动devenv.exe 进程的。 由于机子上同时有3个版本的VC开发器,有时vs2005可以用地版本upgrade到搞版本的.sln文件。但是最近一直很困惑的是,有时一个很早前编译的VC6的工程,过段日子后,再编译升级,

2008-04-16 18:13:00 6298

原创 基于对话框的MFC程序加载位图为背景图案

from:http://rwsk.snnu.edu.cn/?uid-156-action-viewspace-itemid-240先载入一张图片,ID为IDB_BITMAP2  TestDlg.h中CBrush m_brBk;//在public中定义 TestDlg.cpp中在初始化函数OnInitDialog()中加入: BOOL CTestDlg::OnIn

2008-01-08 16:49:00 7788 8

原创 【MFC】在DOC/View格局中创建CDialogBar

1 . 新建一个对话框 ,style选择child2. 用Class Wizard创建一个以CDialog为基类的新的类 3. 注释掉cpp文件中构造函数中的//: CDialog(CMYDIalogBar::IDD, pParent),并将其中出现的CDialog全部更换为CDialogBar3. 自定义消息ON_MESSAGE(WM_INITDIALOG, OnInitDialog

2007-12-30 12:55:00 2727

原创 字符串s中出现的C字符删除的不同实现方法

    1      2    #include   3    #include   4    void delchar(char s[],  char c);  5    int main()  6    {  7        char cc,ch[80];  8          9        cc

2007-12-25 01:57:00 2316

原创 关于回调及其机制

回调函数简介  对于很多初学者来说,往往觉得回调函数很神秘,很想知道回调函数的工作原理。本文将要解释什么是回调函数、它们有什么好处、为什么要使用它们等等问题,在开始之前,假设你已经熟知了函数指针。  什么是回调函数?  简而言之,回调函数就是一个通过函数指针调用的函数。如果你把函数的指针(地址)作为参数传递给另一个函数,当这个指针被用为调用它所指向的函数时,我们就说这是回调函数。

2007-12-24 17:19:00 2916

原创 STL容器可以“装”自定义类型吗?

#include #include #include #include using namespace std;struct  A{public: A() {  i=0;  c=E; } ~A(){} int i; char c;};void swap(int &a,int &b){  a=a+b;  b=a-b;  a=a-b; }int main(){ int a=110,b=

2007-12-22 22:22:00 1160

原创 关于swap函数

从学习C语言以来,都知道要是想交换2个数的值,仅仅用传值的形参是办不到的。如下 void swap(int a,int b)...{      int t;      t=a;      a=b;      b=t;} 于是用传地址或引用的方式可以达到你的目的: void swap(int *a,int *b)...{               int t;   

2007-12-21 17:08:00 1192 2

原创 All the versions of STL

1.4 STL的不同实现版本  相信你对STL的感性认识应该有所提高了,是该做一些实际的工作了,那么我们首先来了解一下STL的不同实现版本。ANSI/ISO C++文件中的STL是一个仅被描述在纸上的标准,对于诸多C++编译器而言,需要有各自实际的STL,它们或多或少的实现了标准中所描述的内容,这样才能够为我们所用。之所以有不同的实现版本,则存在诸多原因,有历史的原因,也有各自编译器生产厂商的

2007-12-16 22:23:00 723

原创 The history of STL

  被誉为STL之父的Alexander Stepanov,出生于苏联莫斯科,早在20世纪70年代后半期,他便已经开始考虑,在保证效率的前提下,将算法从诸多具体应用之中抽象出来的可能性,这便是后来泛型化思想的雏形。为了验证自己的思想,他和纽约州立大学教授Deepak Kapur,伦塞里尔技术学院教授David Musser共同开发了一种叫做Tecton的语言。尽管这次尝试最终没有取得实用性的成果,

2007-12-16 22:20:00 721

原创 关于STL中list的erase()函数

 1      2    #include   3    #include   4    #include   5    #include   6      7    using std::cout;  8    using std::endl;  9    using std::list; 10    using std::iterator; 11    using std::string; 1

2007-12-14 22:24:00 1767

原创 数组与指针

在C、C++语言中,数组和指针关系很密切。如int a[10]={0,1,2,3,4,5,6,7,8,9};则a[0]和*a都可以访问 元素0,其值是0。实际上对于字符串类型也可以的如     int a6=3, b6 = 5;       printf(&a6["Ya!Hello! what is this? %s/n"], &b6["junk/super"]);       pri

2007-12-14 22:14:00 656

原创 Customize your own MFC message

消息映射、循环机制是Windows程序运行的基本方式。VC++ MFC 中有许多现成的消息句柄,可当我们需要完成其它的任务,需要自定义消息,就遇到了一些困难。在MFC ClassWizard中不允许添加用户自定义消息,所以我们必须在程序中添加相应代码,以便可以象处理其它消息一样处理自定义消息。通常的做法是采取以下步骤:Doc/View Application:  第一步:定义消息。  推荐用户

2007-12-05 17:24:00 933

转载 Surviving the Release Version

Surviving the Release VersionIntroductionOK, your program works. Youve tested everything in sight. Its time to ship it. So you make a release version. And the world crumbles to dust.You get

2007-12-05 17:08:00 775

原创 useful macros

macro:大陆译为“宏”,台湾译为“巨集”1,防止一个头文件被重复包含 #ifndef COMDEF_H #define COMDEF_H   //头文件内容 #endif 2,重新定义一些类型,防止由于各种平台和编译器的不同,而产生的类型字节数差异,方便移植。 typedef  unsigned char      boolean;     /* Boolean v

2007-12-05 17:05:00 727

原创 [zz]Determine the maximum of two integers using macro without any operators.

http://www.cyberspace.org/~jhl/miscc.c/******************************************************************************* * Function   : int max(int n1, int n2); * Author     : lovecreatesbeauty@gmail_

2007-12-05 16:57:00 614

Beyond the C++ Standard Library An Introduction to Boost

市面上见的唯一的介绍boost的著作:<br> <br><br> Beyond the C++ Standard Library: An Introduction to Boost <br>By Björn Karlsson <br>............................................... <br>Publisher: Addison Wesley Professional <br>Pub Date: August 31, 2005 <br>ISBN: 0321133544 <br>Pages: 432 <br> <br> <br><br> <br><br>Table of Contents | Index <br> <br>Introducing the Boost libraries: the next breakthrough in C++ programming<br><br>Boost takes you far beyond the C++ Standard Library, making C++ programming more elegant, robust, and productive. Now, for the first time, a leading Boost expert systematically introduces the broad set of Boost libraries and teaches best practices for their use.<br><br>Writing for intermediate-to-advanced C++ developers, Björn Karlsson briefly outlines all 58 Boost libraries, and then presents comprehensive coverage of 12 libraries you're likely to find especially useful. Karlsson's topics range from smart pointers and conversions to containers and data structures, explaining exactly how using each library can improve your code. He offers detailed coverage of higher-order function objects that enable you to write code that is more concise, expressive, and readable. He even takes you "behind the scenes" with Boost, revealing tools and techniques for creating your own generic libraries.<br><br>Coverage includes<br><br>Smart pointers that provide automatic lifetime management of objects and simplify resource sharing<br><br>Consistent, best-practice solutions for performing type conversions and lexical conversions<br><br>Utility classes that make programming simpler and clearer<br><br>Flexible container libraries that solve common problems not covered by the C++ Standard Library<br><br>Powerful support for regular expressions with Boost.Regex<br><br>Function objects defined at the call site with Boost.Bind and Boost.Lambda<br><br>More flexible callbacks with Boost.Function<br><br>Managed signals and slots (a.k.a. the Observer pattern) with Boost.Signals<br><br>The Boost libraries are proving so useful that many of them are planned for inclusion in the next version of the C++ Standard Library. Get your head start now, with Beyond the C++ Standard Library.<br><br>© Copyright Pearson Education. All rights reserved.<br> <br><br> <br>

2007-12-16

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除