共 17 篇文章 |
|
(3)char str1[] = "abc"; char str2[] = "abc"; const char str3[] = "abc"; const char str4[] = "abc"; const char *str5 = "abc"; const char *str6 = "abc"; char *str7 = "abc"; char *str8 = "abc"; cout <<( str1 == str2 ) <<endl; co... 阅3074 转68 评0 公众公开 10-06-08 22:14 |
dynamic_cast <new_type> (expression)reinterpret_cast <new_type> (expression)static_cast <new_type> (expression)const_cast <new_type> (expression)The traditional type-casting equivalents to these expressions would be:(new_type) expressionnew_type (expression)but each one with its own special cha... 阅121 转0 评0 公众公开 10-06-05 14:40 |
A:方法1TYPE * * arrayName;arrayName = new TYPE * [SIZE_1];for ( i=0 ;i<SIZE_1 ;i++ ){备注:在使用这种方法创建的数组时,如果需要把数组传递给函数的时候,可以传递TYPE **的指针,但是如果使用TYPE arrayName[][]创建数组无论几维数组都是TYPE * 的指针,如果试图传递TYPE **的指针,会报告错误方法2(推荐)参见kirbyzhou《关于动态... 阅76 转1 评0 公众公开 10-06-02 10:50 |
这几天Scott Meyers在artima上发起了C++书籍的大讨论,他给我们列了他认为最牛的五本经典书籍,依次是:1、The C++ Programming Language by Bjarne Stroustrup, Addison-Wesley, 1986 (1st edition), 1991 (2nd edition), 1997 (3rd edition), 2000 (special edition). 阅515 转4 评0 公众公开 10-05-03 08:54 |
//或:print_r( get_class_methods($a)); 均返回:Array ( [0] => __construct [1] => getv )echo ''<br />'';print_r( get_class_vars(''test'')); //返回:Array ( [v] => 2 ),和上面不一样,不能用print_r( get_class_methods($a));echo ''<br />'';echo get_parent... 阅437 转4 评0 公众公开 10-04-30 21:53 |
class 的 set_new_handler 允许客户为这个 class 指定 new-handler(正像standard set_new_handler 允许客户指定global new-handler)。static std::new_handler set_new_handler(std::new_handler p) throw();std::new_handler Widget::set_new_handler(std::new_handler p) throw(){Widget::set_new_handler(outOfMem);template<typename ... 阅150 转0 评0 公众公开 10-04-30 15:20 |
操作符重载1.有四个操作符不允许重载,它们是:: .* .?:2.程序员只能为类类型或枚举类型的操作数定义重载操作符3.除了operator()之外,对其他重载操作符提供缺省实参都是非法的4.c++要求,=,[],()和->四个操作符必须被定义为类成员操作符,否则会编译错误5.操作符->被重载为一元操作符,即它没有参数。8.new操作符重载的参数与delete一... 阅1149 转3 评0 公众公开 10-04-25 02:21 |
long kk, kk11, kk12, kk13, kk21, kk22, kk23, kk31, kk32, kk33, size;if((g[kk12]&&g[kk21]&&g[kk23]&&g[kk32])!nrn = g[kk11] + g[kk12] + g[kk13] + g[kk21] + g[kk23] + g[kk31] + g[kk32] + g[kk33];long kk,kk1,kk2,kk3;for(i=0, kk1=0, kk2=ly-1;i++, kk1+=ly, kk2+=ly) { f[kk1]=0;} if(f[kk... 阅59 转自mtjs 公众公开 10-04-25 01:06 |
图像直方图是图像处理中一种十分重要的图像分析工具,它描述了一幅图像的灰度级内容,任何一幅图像的直方图都包含了丰富的信息,它主要用在图象分割,图像灰度变换等处理过程中。从数学上来说图像直方图是图像各灰度值统计特性与图像灰度值的函数,它统计一幅图像中各个灰度级出现的次数或概率;假定输入图像中的一个像素的灰度级为Z,经过T(Z)... 阅122 转自mtjs 公众公开 10-04-25 01:05 |