<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > c語言指針的學(xué)習(xí)心得

          c語言指針的學(xué)習(xí)心得

          作者: 時(shí)間:2016-12-01 來源:網(wǎng)絡(luò) 收藏
          #include<心得>

          main()
          {
          view *有求于人;
          if(真的做不到)
          {
          point *怎么辦?
          怎么辦?=&可以去找比自己犀利的人尋求;
          }
          else(做的到&&但是自己不想努力去做)
          {
          result *怎么辦?
          怎么辦?=&悲??;
          }
          有求于人=怎么辦;
          printf(“有求于人=%chinese”,有求于人);
          }
          人生道路慢慢曲折,想得到穩(wěn)定的發(fā)展和提高,要時(shí)刻思考,如果他不在我身邊怎么辦,多多去尋找自己解決問題的途徑。指針在傳遞過程,是全傳遞,而實(shí)參傳遞是部分傳遞。
          #include
          main()
          {
          int a,b;
          int*p1,*p2;
          a=1;b=3;
          // scanf("%d,%d",&a,&b);
          p1=&a;p2=&b;
          if(aswap(p1,p2);
          printf("%d,%d",a,b);
          }
          swap(int *pa,int *pb)
          {
          int p;
          p=*pa;
          *pa=*pb;
          *pb=p;
          }

          本文引用地址:http://www.ex-cimer.com/article/201612/324454.htm

          --------------------------------------------------------------
          筆記2:指針函數(shù)
          #include
          main()
          {
          int a,b,c;
          int max(a,b);
          int (*p)(a,b);
          p=&max;
          scanf("%d%d",&a,&b);
          c=(*p)(a,b);
          printf("max=%d",c);

          while(1);
          }
          max(a,b)
          {
          if(a>b)
          {
          return a;
          }
          else
          {
          return b;
          }
          }

          -------------------------------------------------------------------------------------------------
          筆記3:多維數(shù)組乃一維之嵌套。
          筆記4:結(jié)構(gòu)體指針。
          main()
          { struct student
          { long int num;
          char name[20];
          char ***;
          float score;
          }stu_1,*p;
          p=&stu_1;
          stu_1.num=89757;
          strcpy(stu_1.name,"Li Lin");
          p->***=‘M‘;
          p->score=89.5;
          printf("No:%ldname:%s***:%cscore:%f",
          (*p).num , p->name , stu_1.*** , p->score );
          }
          筆記5:較難理解的部分,結(jié)構(gòu)化指針整體使用
          #include
          struct complex add(struct complex,struct complex);
          struct complex
          {
          double re;//實(shí)部
          double im;//虛部
          };
          struct complex add(struct complex a,struct complex b)
          {
          struct complex c;
          c.re=a.re+b.re;
          c.im=a.im+b.im;
          return c;
          }
          int main()
          {
          struct complex x={6.5,8.9},y={7.1,9.4};
          struct complex z;
          z=add(x,y);
          printf("和為:%5.2lf+i%5.2lf",z.re,z.im);
          }
          /*#include
          struct student
          {
          int num;
          char *name;
          char ***;
          float score;
          }stu={1,"張賓",F,55},*pstu;
          int main()
          {
          pstu=&stu;
          printf("學(xué)號:%d 姓名:%s",stu.num,stu.name);
          printf("性別:%c 成績:%5.2f",stu.***,stu.score);
          printf("學(xué)號:%d 姓名:%s",(*pstu).num,(*pstu).name);
          printf("性別:%c 成績:%5.2f",(*pstu).***,(*pstu).score);
          printf("學(xué)號:%d 姓名:%s",pstu->num,pstu->name);
          printf("性別:%c 成績:%5.2f",pstu->***,pstu->score);
          while(1);

          }
          */



          評論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();