"); //-->
//数组和指针数组 #include <stdio.h> int arry[3]={0,1,2}; int *row[3]; int i=0; int *p; int main(void) { p=arry; printf("test\r\n"); for(i=0;i<3;i++) { printf("the num is %d \r\n",*p); p++; } p=arry; for(i=0;i<3;i++) { row[i]=p; p++; } p=arry; row[i]=arry; for(i=0;i<3;i++) { printf("the num is %d \r\n",*row[i]); } return 0; }
//数组和数组指针 #include <stdio.h> int main(void) { int arry[3][3]={0,1,2,3,4,5,6,7,8}; int (*p)[3]; printf("the date is %d \r\n",arry[2][2]); p= arry; printf("the date is %d \r\n",**p); printf("the date is %d \r\n",*(*p+1)); return 0; }
//指针函数 #include <stdio.h> #include <stdlib.h> typedef struct data { int a; int b; }data; data *change(int a,int b) { data* data1 =(data *)malloc(sizeof(data1)) ; data1->a=b; data1->b=a; return data1; } int main(void) { data *mydata=change(2,3); printf("mydata is a = %d ,b=%d",mydata->a,mydata->b); return 0; }
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。
eleaction01 阅读:2915