<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>C言語の学習で、関数での文字列の扱いははまりどころじゃね？ へのコメント</title>
	<atom:link href="http://ganchiku.com/2007/08/i_had_trouble_to_use_string_with_c.html/feed" rel="self" type="application/rss+xml" />
	<link>http://ganchiku.com/2007/08/i_had_trouble_to_use_string_with_c.html</link>
	<description>renewal, baby!</description>
	<lastBuildDate>Wed, 11 Jan 2012 03:19:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>shin より</title>
		<link>http://ganchiku.com/2007/08/i_had_trouble_to_use_string_with_c.html#comment-157</link>
		<dc:creator>shin</dc:creator>
		<pubDate>Tue, 21 Aug 2007 14:18:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.ganchiku.com/?p=214#comment-157</guid>
		<description>ooiさん

コメントありがとうございます。

確かに開放忘れをしないようにしないといけないですね。

でも、今は、文字列のみならず、使いやすいバッファを構造体で持っておいて、それをmallocする関数（コンストラクタ）とfreeする関数（デストラクタ）のように使おうと思っています。また、その上にリストやハッシュの構造体を持って、それもmallocするコンストラクタとfreeするデストラクタを持っておいて、それ以外はmallocしない予定です。ポリシーがしっかりしていれば、開放忘れヶがなくなると思いますので、もう少し勉強してみます。
Cのデータ構造は奥が深いですね。。</description>
		<content:encoded><![CDATA[<p>ooiさん</p>
<p>コメントありがとうございます。</p>
<p>確かに開放忘れをしないようにしないといけないですね。</p>
<p>でも、今は、文字列のみならず、使いやすいバッファを構造体で持っておいて、それをmallocする関数（コンストラクタ）とfreeする関数（デストラクタ）のように使おうと思っています。また、その上にリストやハッシュの構造体を持って、それもmallocするコンストラクタとfreeするデストラクタを持っておいて、それ以外はmallocしない予定です。ポリシーがしっかりしていれば、開放忘れヶがなくなると思いますので、もう少し勉強してみます。<br />
Cのデータ構造は奥が深いですね。。</p>
]]></content:encoded>
	</item>
	<item>
		<title>ooi より</title>
		<link>http://ganchiku.com/2007/08/i_had_trouble_to_use_string_with_c.html#comment-156</link>
		<dc:creator>ooi</dc:creator>
		<pubDate>Tue, 21 Aug 2007 03:16:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ganchiku.com/?p=214#comment-156</guid>
		<description>mallocとfreeはできるだけ見えるところ、同じ関数内で行うようにしたほうが、開放し忘れとかなくていいですよ。</description>
		<content:encoded><![CDATA[<p>mallocとfreeはできるだけ見えるところ、同じ関数内で行うようにしたほうが、開放し忘れとかなくていいですよ。</p>
]]></content:encoded>
	</item>
	<item>
		<title>shin より</title>
		<link>http://ganchiku.com/2007/08/i_had_trouble_to_use_string_with_c.html#comment-155</link>
		<dc:creator>shin</dc:creator>
		<pubDate>Sun, 19 Aug 2007 23:19:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.ganchiku.com/?p=214#comment-155</guid>
		<description>BigFatCatさん

コメントどうもです。

そうですね。それも一つの手段ですね。
私が上で書いた
「関数の呼び出し元で文字の配列を予め確保しておく（静的に確保しても良いし、mallocで確保しても良い）。そして、そのサイズと一緒に引数にしてにその関数を呼び出す。」
の静的に確保するというのが、その方法を意味しているつもりでしたが、説明がわかりにくくてすいません。</description>
		<content:encoded><![CDATA[<p>BigFatCatさん</p>
<p>コメントどうもです。</p>
<p>そうですね。それも一つの手段ですね。<br />
私が上で書いた<br />
「関数の呼び出し元で文字の配列を予め確保しておく（静的に確保しても良いし、mallocで確保しても良い）。そして、そのサイズと一緒に引数にしてにその関数を呼び出す。」<br />
の静的に確保するというのが、その方法を意味しているつもりでしたが、説明がわかりにくくてすいません。</p>
]]></content:encoded>
	</item>
	<item>
		<title>BigFatCat より</title>
		<link>http://ganchiku.com/2007/08/i_had_trouble_to_use_string_with_c.html#comment-154</link>
		<dc:creator>BigFatCat</dc:creator>
		<pubDate>Sun, 19 Aug 2007 16:58:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.ganchiku.com/?p=214#comment-154</guid>
		<description>呼び出し元で配列のサイズの上限が分かってればの話ですが、呼び出し元で配列を用意してやって、そこに結果をつめてもらうようにすれば良いのでは？</description>
		<content:encoded><![CDATA[<p>呼び出し元で配列のサイズの上限が分かってればの話ですが、呼び出し元で配列を用意してやって、そこに結果をつめてもらうようにすれば良いのでは？</p>
]]></content:encoded>
	</item>
	<item>
		<title>K より</title>
		<link>http://ganchiku.com/2007/08/i_had_trouble_to_use_string_with_c.html#comment-153</link>
		<dc:creator>K</dc:creator>
		<pubDate>Sat, 18 Aug 2007 14:57:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.ganchiku.com/?p=214#comment-153</guid>
		<description>あ、なんとなく違和感わかりました。
ぼくは static に加えて const が付くようなのを想像してました。</description>
		<content:encoded><![CDATA[<p>あ、なんとなく違和感わかりました。<br />
ぼくは static に加えて const が付くようなのを想像してました。</p>
]]></content:encoded>
	</item>
</channel>
</rss>

