zoukankan      html  css  js  c++  java
  • 截取字符串(C版)

    下面代码中全是c的东西

    本人写了一个字符串子串获取方法

     1 char *SubString(char *dest ,const char *source ,int iBegin ,int iLen)
     2 {
     3     char *result = dest;
     4     
     5     if (source == NULL)
     6         return result;
     7     
     8     if (iBegin < 0 || iLen < 1)
     9         return result;
    10         
    11     while(iBegin-- != 0)
    12         source++;
    13     
    14     while(iLen-- != 0 && *source != '\0')
    15     {
    16         *dest = *source;
    17         dest++;
    18         source++;
    19     }
    20     
    21     *dest = '\0';
    22     
    23     return result;
    24 }


    好,贴出完整代码,用tc3.0编译通过

    ShowCode



  • 相关阅读:
    6.Docker中上传镜像到docker hub中
    altermanager使用报错
    Grafana官方和社区提供的dashboard
    什么是 云原生?
    prometheus被OOM杀死
    新版GRANAFA K8S插件 K8S NODE 图表不显示问题解决方法
    python2和python3的不同
    一次使用Python连接数据库生成二维码并安装为windows服务的工作任务
    Python连接oracle
    numpy.ndarray的赋值操作
  • 原文地址:https://www.cnblogs.com/GoGoagg/p/1283222.html
Copyright © 2011-2022 走看看