<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://www.gentoo-zh.org/extern.php?action=feed&amp;tid=395&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo中文社区 / C 练习实例86]]></title>
		<link>https://www.gentoo-zh.org/viewtopic.php?id=395</link>
		<description><![CDATA[C 练习实例86 最近发表的帖子。]]></description>
		<lastBuildDate>Mon, 29 Aug 2022 11:50:57 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[C 练习实例86]]></title>
			<link>https://www.gentoo-zh.org/viewtopic.php?pid=401#p401</link>
			<description><![CDATA[<p>题目：两个字符串连接程序 。</p><p>程序分析：无。</p><p>程序源代码：</p><div class="codebox"><pre><code>#include &lt;stdio.h&gt;
#include&lt;stdlib.h&gt;
#include&lt;string.h&gt;
 
char* strconnect(char *str1,char *str2);
 
int main()
{
    char str1[20],str2[20];
    char *str;
    puts(&quot;请输入两个字符串，用回车分开:&quot;);
    scanf(&quot;%s%s&quot;, str1, str2);
    str=strconnect(str1,str2);
    puts(&quot;连接后的字符串为:&quot;);
    puts(str);
    return 0;
}
char* strconnect(char *str1,char *str2)
{
    char*str;
    str=(char*)malloc(strlen(str1)+strlen(str2)+1);
    str[0]=&#039;\0&#039;;
    strcat(str,str1);
    strcat(str,str2);
    return str;
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Mon, 29 Aug 2022 11:50:57 +0000</pubDate>
			<guid>https://www.gentoo-zh.org/viewtopic.php?pid=401#p401</guid>
		</item>
	</channel>
</rss>
