随笔分类 -  C++

指向常量的指针和常量指针
摘要:const char* pc=str; //指向常量,指向地址可以改,指向的目标不能改char *const pc=str; //常量指针,指向地址不能改,指向的目标可以改const char *const pc=str; //都不能改 阅读全文
posted @ 2015-02-02 02:50 龙骑骑龙 阅读(66) 评论(0) 推荐(0)
c++和c#中数组的区别
摘要:c#:int[] array1; int[] array2 = new int[2]; int[] array3 = new int[] { 1, 2, 3 };//new int[]方括号中可以写长度也可以不写,但是写了的话必须和花括号中的元素数量相等,不等则报错 ... 阅读全文
posted @ 2014-11-05 00:50 龙骑骑龙 阅读(505) 评论(0) 推荐(0)