1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      c語言指針練習(xí)(day9)-創(chuàng)新互聯(lián)

      1,使用指針實現(xiàn)字符串拷貝

      讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對這個行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價值的長期合作伙伴,公司提供的服務(wù)項目有:域名與空間、虛擬空間、營銷軟件、網(wǎng)站建設(shè)、郁南網(wǎng)站維護(hù)、網(wǎng)站推廣。

      void MyStrcpy(char *p,char *q)

      #include
      #include
      void MyStrcpy(char *p,char *q)
      {
      ?int n=strlen(q);
      ?for(int i=0;i ?{
      ??? ?*(p+i)=*(q+i);
      ?}*(p+n)='\0';
      }
      int main(int argc, const char *argv[])
      {
      ?char str[]="";
      ?char str1[]="asdfg";
      ?MyStrcpy(str,str1);
      ?puts(str);
      ?return 0;
      }

      2.使用指針實現(xiàn)字符串比較

      Void MyStrcmp(char *p,char *q)

      #include
      void MyStrcmp(char *p,char *q)
      {
      ?int i=0,j=0;
      ?int cha;
      ?while(*(q+i)==*(p+j))
      ?{
      ??? ?if(*(p+i)=='\0'&&*(q+i)=='\0')
      ??? ?{
      ??? ??? ?cha=*(p+i)-*(q+j);
      ??? ??? ?break;
      ??? ?}
      ??? ?else
      ??? ?{
      ??? ??? ?i++;
      ??? ??? ?j++;
      ??? ?}
      ?}
      ?cha=*(p+i)-*(q+j);
      ?if(cha==0)
      ??? ?printf("str=str1\n");
      ?else if(cha>0)
      ??? ?printf("str>str1\n");
      ?else
      ??? ?printf("str}
      int main(int argc, const char *argv[])
      {
      ?char str[]="asefds";
      ?char str1[]="edfsfc";
      ?MyStrcmp(str,str1);
      ?return 0;
      }

      3,使用指針實現(xiàn)計算單詞的個數(shù),返回單詞的個數(shù)

      Char str[]=”hello? my? student”

      輸出有3個字符串

      Int? StrNum(char *p)

      #include
      #include
      int StrNum(char *p)
      {
      ?int i=0,c=0,n=strlen(p);
      ?while(*(p+i)!='\0')
      ?{
      ??? ?if(*(p+i)!=' '&&*(p+i+1)==' '||*(p+i+1)=='\0')
      ??? ?{
      ??? ??? ??? ?c++;
      ??? ?}
      ??? ?i++;
      ?}return c;
      }
      int main(int argc, const char *argv[])
      {
      ?char str[]="hello ?my ?student";
      ?printf("有%d個單詞。\n",StrNum(str));
      ?return 0;
      }

      你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級服務(wù)器適合批量采購,新人活動首月15元起,快前往官網(wǎng)查看詳情吧


      當(dāng)前題目:c語言指針練習(xí)(day9)-創(chuàng)新互聯(lián)
      標(biāo)題來源:http://www.ef60e0e.cn/article/cseios.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        台安县| 夏邑县| 文化| 上高县| 昔阳县| 贡觉县| 阳信县| 大厂| 荣成市| 洛南县| 万全县| 枞阳县| 民权县| 台中县| 小金县| 卫辉市| 会同县| 古交市| 大竹县| 孟村| 和顺县| 紫云| 玉田县| 临颍县| 东安县| 当阳市| 开封市| 缙云县| 资兴市| 石楼县| 永平县| 佛坪县| 封开县| 且末县| 梁平县| 阿荣旗| 洞头县| 鲁山县| 黎城县| 徐州市| 六枝特区|