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



  • 相关阅读:
    解决input 输入框频繁请求问题,如果拿取最后一次接口返回的值
    记录两个小问题
    axios 如何取消请求
    给vue组件绑定原生事件
    Vue3 与 Vue2的不同之处一 简单介绍 Vue 核心最基本的功能
    js将数组对象中,以某个值相同的对象合并成一个;即把某个值相同的对象内容合并成一个
    postcss-preset-env
    webpack5 tree shaking
    深拷贝
    webpack 性能优化
  • 原文地址:https://www.cnblogs.com/GoGoagg/p/1283222.html
Copyright © 2011-2022 走看看