第7章第20题关键函数

void Replace(node* const head, char& target, char& s)

{

    if(head == NULL || head->pNext == NULL)

    {

        // 原字符串为空,直接返回

        return;

    }

 

    node* temphead = head->pNext;

 

    while(temphead->pNext != NULL)

    {

        if(temphead->data == target)

        {

            temphead->data = s;

        }

        //相等则替换

 

        temphead = temphead->pNext;

    }

    return;

}

Advertisements

2 responses to this post.

  1. Posted by 小猴子颤颤 on 2006年04月12日 at 11:58

    关于那个配色,我是故意的……看得清和看不清不都是一回事么……看来你过得还不错哦!加油加油!

    回复

  2. Posted by 小雨 on 2006年04月16日 at 02:51

    加油!

    回复

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: