2007年3月5日

摘要: 1.值替代const 和 define比有类型检查2.指针指向const的指针const int* uint const* uconst指针int* const w;int d=1;const int* const x = &d;int const* const x2 = &d;现在,指针和对象都不能改变3.函数和返回值传递const值void f1(const int i){ i++; //illegal -- compile-time error}返回const值const int g();对于内部类型(int, char)来说,按值返回的是否是一个const,是无关紧要的 阅读全文

posted @ 2007-03-05 16:01 Teddy Yan 阅读(146) 评论(0) 推荐(0) 编辑

摘要: STL GP--generic programIt's same to OOP, it's an other program method.Class TemplateHow C++ Templates Enable Generic Programming1.Class TemplatesThere is usually more to making an ordinary class into a generic one than just adding the template keyword and type parameter list. Some modificati 阅读全文

posted @ 2007-03-05 15:58 Teddy Yan 阅读(150) 评论(0) 推荐(0) 编辑


Copyright © 2024 Teddy Yan
Powered by .NET 9.0 on Kubernetes