摘要: #include<stdio.h>void swap(int *px, int *py){ int temp; temp = *px; *px = *py; *py =temp;}int main(int argc,char **argv) { int x = 1, y = 2; printf("x,y is %d,%d\n",x,y); swap(&x,&y); /* int *px = &x; int *py = &y; swap(px,py); */ printf("x,y is %d,%d\n",x,y 阅读全文
posted @ 2012-11-01 23:58 代码示例 阅读(720) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stddef.h>int main(int argc,char **argv) { char c; char *p = &c; printf("len of char is %d\n",sizeof *p); int x = 1, y = 2, z[10]={8,22,33}; int *ip = &x; printf("x,y is %d,%d\n",x,y); y= *ip; printf("x,y is %d,%d\n",x,y); *i 阅读全文
posted @ 2012-11-01 23:46 代码示例 阅读(830) 评论(0) 推荐(0) 编辑