// re.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
/*
将 str 中的 chDel 字符都?除,返回被?除的 chDel 的个数,
函数?行?束返回?除了chDel 字符串 str
*/
int ReplaceSpace(char* str,char chDel)
{
if(!str || '\0' == *str)
return 0;// 如果字符串?空 或者?度? 1 ,?返回 0
int moveForward = 1;
char * pIndex = pIndex = str;
// char * pI = str;
//int i = 0;
// while('\0' != *pI)
//{
// if(/*' '*/chDel == *pI)
// {
// i++;
// }
// pI++;
//}
while('\0' != *pIndex)
{
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载