随笔分类 -  C/C++

C/C++ programming skills
VC++编译器中一些常见precompiling 指令介绍
摘要:本文介绍了在VC中常见的预编译指令,包括#pragma once,#pragma comment() ,_cdecl,_stdcall等等。 阅读全文

posted @ 2008-09-12 10:22 飞天舞者 阅读(500) 评论(0) 推荐(0) 编辑

函数调用的区别:_cdecl以及_stdcall
摘要:本文介绍了函数的不同调用方式,主要介绍了_stdcall和_cdecl的区别 阅读全文

posted @ 2008-09-11 18:03 飞天舞者 阅读(2642) 评论(1) 推荐(0) 编辑

深入剖析C++中的string类
摘要:C++中的定义了字符串类string, 其和C中的string.h有着很大区别,但是很多时候由于程序的延续性需要互相操作,因此需要对于string类有很深入的了解。 阅读全文

posted @ 2008-07-19 16:26 飞天舞者 阅读(4322) 评论(1) 推荐(0) 编辑

静态链接库LIB和动态链接库DLL的区别 创建和示例
摘要:静态链接库与动态链接库都是共享代码的方式... 阅读全文

posted @ 2008-07-05 14:35 飞天舞者 阅读(20289) 评论(2) 推荐(2) 编辑

运算转换符static_cast,const_cast,reinterpret_cast,dynamic_cast之间的区别
摘要:运算转换符static_cast,const_cast,reinterpret_cast,dynamic_cast之间的区别 阅读全文

posted @ 2008-07-01 14:56 飞天舞者 阅读(1992) 评论(0) 推荐(0) 编辑

C++中多态的实现原理
摘要:本文通过由代码调试和runtime时候的Debug,讲解了多态的实现原理及过程,从而有助于深入理解多态的概念。 阅读全文

posted @ 2008-06-30 16:27 飞天舞者 阅读(3368) 评论(8) 推荐(1) 编辑

C++本质:类的赋值运算符=的重载,以及深拷贝和浅拷贝
摘要:在面向对象程序设计中,对象间的相互拷贝和赋值是经常进行的操作。 如果对象在申明的同时马上进行的初始化操作,则称之为拷贝运算。例如: class1 A("af"); class1 B=A; 此时其实际调用的是B(A)这样的浅拷贝操作。 如果对象在申明之后,在进行的赋值运算,我们称之为赋值运算。例如: class1 A("af"); class1 B; B=A; 此时实际调用的类的缺省赋值函数B.operator=(A); 不管是浅拷贝还是赋值运算,其都有缺省的定义。也就是说,即使我们不overload这两种operation,仍然可以运行。 那么,我们到底需不需要overload这两种operation 呢? 阅读全文

posted @ 2008-06-03 11:15 飞天舞者 阅读(21679) 评论(3) 推荐(8) 编辑

C/C++ Basics--function pointer
摘要:1.basic concepts function pointer in C/C++ is just like delegate in C#. we can use function pointer to point to a specific function, and then use function pointer to invoke the specified function.... 阅读全文

posted @ 2008-04-08 16:03 飞天舞者 阅读(345) 评论(0) 推荐(0) 编辑

C/C++ Basic-- the differs between [malloc&free] and [new &delete]
摘要:1.basic concepts malloc&free and new&delete are all used to request memory allocation and release memory allocated from heap area. eg. malloc.h must be referenced when using malloc&free ... 阅读全文

posted @ 2008-04-08 15:05 飞天舞者 阅读(297) 评论(0) 推荐(1) 编辑

C/C++ Basics-->about #define, const
摘要:1. In C programming, the normal use of #define is to declare an constant vairiable. But it's been replaced by const. C: #define X 100 ----> C++: const int x=100; 2. #define can also define ... 阅读全文

posted @ 2008-04-08 14:10 飞天舞者 阅读(387) 评论(0) 推荐(0) 编辑

OPP Basic--if virtual functions are so powerful, can we declare all member functions virtual?
摘要:A: Never. cos virtual functions has costs. Each object of virtual function must have a v table to manage them.Therefore using virtual function will need system costs. for only a very small class and ... 阅读全文

posted @ 2008-02-26 11:32 飞天舞者 阅读(183) 评论(0) 推荐(0) 编辑

OOP Bisic-desctructor can be virtual,while constructer can not? why?
摘要:A: virtual function uses virtual calling. virtual calling is a kind of operation mechanism which can run on the condition of part information being provided. it allows us to call a function that... 阅读全文

posted @ 2008-02-26 11:21 飞天舞者 阅读(238) 评论(0) 推荐(0) 编辑

OOP Basic--Constructor&Destructor
摘要:本文深刻讲述了为什么有些基类的析构函数要设为virtual? 阅读全文

posted @ 2008-02-26 10:59 飞天舞者 阅读(353) 评论(0) 推荐(0) 编辑

OOP Basic--Is the class declaration right?[const]
摘要:Q: in C++ programming language, Is it right to define a class as the following shown: class A{ const int Size=0; } A: no, it's wrong! 在C++中,这样是错误的,常量成员的初始化必须在构造函数中完成。 the initiation of const must be... 阅读全文

posted @ 2008-02-26 10:31 飞天舞者 阅读(267) 评论(0) 推荐(0) 编辑

OOP Basic--what's the diff between struct & class?
摘要:Q: if struct can have the construtor/desctructor and memeber functions ? if so, what's the diff between struct& class? A: Yes! and the diff is that: in Class ,the default variables access typ... 阅读全文

posted @ 2008-02-26 10:27 飞天舞者 阅读(241) 评论(0) 推荐(0) 编辑

STL template&Container--function point & generic class
摘要:please wirte a program to realize the model described in the figure. you shoudl design your program as negeric as possible so that we can enhance the model in the future ealily without making too ... 阅读全文

posted @ 2008-02-26 09:57 飞天舞者 阅读(400) 评论(0) 推荐(0) 编辑

STL template&Container--how to change normal function into generic function.
摘要:Q: Below is usual way we find one element in an array: in this case we have to bear the knowledge of value type"int",the size of array,even the existence of an array. would you re-write it... 阅读全文

posted @ 2008-02-26 09:45 飞天舞者 阅读(265) 评论(0) 推荐(0) 编辑

Programming Basic--what is the output of the following code?
摘要:#include "iostream" #include"string.h" #include "stdio.h" class A{ }; class A2{ char d,e; }; struct B{ }; struct C{ char b,c; }; struct D{ int x,y; }; int main() { count<<sizeof(A)<<endl; cout<<... 阅读全文

posted @ 2008-02-26 09:05 飞天舞者 阅读(400) 评论(0) 推荐(0) 编辑

Programming Basic--what's the diff between const and #define?
摘要:to define a const, we can use const as well as #define in C++ .however the former has more benifits than later. 1) const has data type ,however Macro has no. so the complier can check ... 阅读全文

posted @ 2008-02-26 08:58 飞天舞者 阅读(204) 评论(0) 推荐(0) 编辑

Programming Basic--what's the use of "ifndef/define/endif";
摘要:to avoid that the head file is referenced more than twice. 阅读全文

posted @ 2008-02-26 08:51 飞天舞者 阅读(200) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
For more information about me, feel free email to me winston.he@hotmail.com
点击右上角即可分享
微信分享提示