摘要: http://c.biancheng.net/cpp/html/476.html 阅读全文
posted @ 2017-06-18 15:01 cheshulin 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 用二级指针作为函数参数,有两种典型情况:1、需要传递一级指针的数组时:例如标准C的main函数:int main(int argc, char*[] argv),数组最高维可以退化,char*[] argv等价于char** argv。这里argv代表命令行参数数组。2、需要对传入的一级指针进行修改 阅读全文
posted @ 2017-06-18 11:44 cheshulin 阅读(2280) 评论(0) 推荐(0) 编辑
摘要: #include #include #include "string.h" struct student { int age; char *name;//char name[10]; }; /* 指针传递,省去拷贝时间 */ void stuprint(student *pst) { printf("形参地址%p\r\n",pst); printf("pst... 阅读全文
posted @ 2017-06-18 11:07 cheshulin 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include "string.h" 4 /* 数值传递 */ 5 void test1(int **ppint) 6 { 7 int *pint=(int *)malloc(sizeof(int)*100);//为什么在这里会报错 8 ppint=&pint; 9 10 } 11 /* 指针传递 */ ... 阅读全文
posted @ 2017-06-18 10:23 cheshulin 阅读(241) 评论(0) 推荐(0) 编辑