------------------------3
生活随笔
收集整理的這篇文章主要介紹了
------------------------3
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
百看成仙第二篇-----指針篇
#include <stdio.h> struct point{int x;int y; };struct point* getStruct(struct point *p); vius output(struct point); void print(const struct point p) void main(){struct point y = {0,0};getStruct(y);output(y);output(*getStruct(&y));print(getStruct(&y));getStruct(&y)-> x = 0;*getStruct(&y) = (struct point){1,2}; }struct point* getStruct(struct point *p){scanf("%d",&p->x);scanf("%d",&p->y);printf("%d,%d",p->x,p->y);return p; }void outpoint(struct point){printf("%d,%d",p.x,p.y); }void print(const struct point p){printf("%d,%d",p->x,p->y); }總結(jié)
以上是生活随笔為你收集整理的------------------------3的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 产品开发的心得(一)
- 下一篇: 读书学习方法