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



  • 相关阅读:
    c++流迭代器
    SQL Server中的临时表和表变量
    基于组件的.NET软件开发
    COM组件转换成.NET组件
    将.net组件注册为com组件
    命令提示符窗口中的快捷键
    Log4net: use Sql Server to log your application events
    Retrieving the COM class factory for component with CLSID {0002450000000000C000000000000046} failed due to the following error: 80070005.
    Office Primary Interop Assemblies
    Adding custom code to Local Reports in Visual Studio.NET 2005 (Problems & Solutions)
  • 原文地址:https://www.cnblogs.com/GoGoagg/p/1283222.html
Copyright © 2011-2022 走看看