<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BPS株式会社 開発ブログ Beyond Perspective Solutions LTD. &#187; C++</title>
	<atom:link href="http://www.bpsinc.jp/blog/archives/category/programming-language/c/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bpsinc.jp/blog</link>
	<description>BPS株式会社（Beyond Perspective Solutions）のプログラマによる技術・開発などに関してのブログです</description>
	<lastBuildDate>Wed, 20 Jul 2011 08:14:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>true/false一覧君</title>
		<link>http://www.bpsinc.jp/blog/archives/1686</link>
		<comments>http://www.bpsinc.jp/blog/archives/1686#comments</comments>
		<pubDate>Sat, 12 Jun 2010 00:01:24 +0000</pubDate>
		<dc:creator>baba</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[プログラミング言語]]></category>
		<category><![CDATA[馬場]]></category>
		<category><![CDATA[入門]]></category>

		<guid isPermaLink="false">http://www.bpsinc.jp/blog/?p=1686</guid>
		<description><![CDATA[当然ながら、言語ごとに真偽判定（true/false）の基準が違います。
特にスクリプト系の言語では、明示的に型を指定しないことが多いので、たまに問題になります。
たまたま手元にあった環境で、どんな値が真に判定されるのか [...]]]></description>
			<content:encoded><![CDATA[<p>当然ながら、言語ごとに真偽判定（true/false）の基準が違います。</p>
<p>特にスクリプト系の言語では、明示的に型を指定しないことが多いので、たまに問題になります。</p>
<p>たまたま手元にあった環境で、どんな値が真に判定されるのか、というのをまとめてみました。<br />
新しい言語に突撃するときのメモ代わりにでもして頂ければ幸いです。</p>
<p>検証コードイメージ</p>
<pre class="brush:ruby">
a = 0
if a
  print 'true'
else
  print 'false'
end
</pre>
<p><a href="http://www.bpsinc.jp/blog/wp-content/uploads/2010/05/truefalse.png"><img src="http://www.bpsinc.jp/blog/wp-content/uploads/2010/05/truefalse.png" alt="truefalse" title="truefalse" width="623" class="aligncenter size-full wp-image-1687" /></a></p>
<p>凡例：<br />
× は、コンパイルエラー<br />
ｰ は、言語仕様にその値が存在しない</p>
<p>備考：<br />
*&#8221;" というのは、ナル文字の値を指す（\0なので、実体はゼロという整数値）<br />
array[] というのは、各言語での空の配列を指す<br />
※1　C言語にfalseは存在しない<br />
※2　配列のアドレスを指すため、真と評価される<br />
※3　noticeが発生するが、設定や@で抑制可能</p>
<p>こうしてみると、やはりPHPは変態です。&#8217;0&#8242; をfalseと判定する言語はあまりないですね。Webに特化しているのがよくわかります。$_GETなどは文字列で渡ってくるので、確かに手抜きに便利仕様です。</p>
<p>空配列をfalseと判定するのが、PythonとPHPというなんだかおもしろい組み合わせになりました。<br />
良く忘れるけど、rubyはゼロという数字をtrueに判定するので注意が必要ですね。</p>
<p>結局、ミスのしようが無い Java / C# は安全で好きです。<br />
また、ゼロは false、ほかは true と割り切ったC言語も、シンプルで好きです。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpsinc.jp/blog/archives/1686/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ウィンドウを背後に移動</title>
		<link>http://www.bpsinc.jp/blog/archives/1152</link>
		<comments>http://www.bpsinc.jp/blog/archives/1152#comments</comments>
		<pubDate>Thu, 25 Feb 2010 00:20:47 +0000</pubDate>
		<dc:creator>baba</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[馬場]]></category>

		<guid isPermaLink="false">http://www.bpsinc.jp/blog/?p=1152</guid>
		<description><![CDATA[数年前に作ったミニアプリを公開してみました。
WinBottom
ウィンドウの最小化ボタンを右クリックすると、そのウィンドウが背面に移動するだけの常駐ソフトです。
くだらないですが、大型ディスプレイでは地味に便利です。
 [...]]]></description>
			<content:encoded><![CDATA[<p>数年前に作ったミニアプリを公開してみました。</p>
<p><a href="http://www.bpsinc.jp/blog/mini-software/winbottom">WinBottom</a></p>
<p>ウィンドウの最小化ボタンを右クリックすると、そのウィンドウが背面に移動するだけの常駐ソフトです。<br />
くだらないですが、大型ディスプレイでは地味に便利です。</p>
<p>アイコンが猫の手なので、おすすめです。</p>
<p>極小なのでほとんど何も書いていないですが、もしソースが欲しい等の変な方がいたらご連絡ください。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpsinc.jp/blog/archives/1152/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studioで構文エラー：__RPC__out_xcount_part が出たとき</title>
		<link>http://www.bpsinc.jp/blog/archives/998</link>
		<comments>http://www.bpsinc.jp/blog/archives/998#comments</comments>
		<pubDate>Tue, 19 Jan 2010 23:58:12 +0000</pubDate>
		<dc:creator>baba</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[馬場]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[エラー]]></category>

		<guid isPermaLink="false">http://www.bpsinc.jp/blog/?p=998</guid>
		<description><![CDATA[Visual Studio 2010 beta特有の問題かもしれませんが、windows.hをincludeしたときに、以下のようなエラーが出る場合があります。

c:\program files (x86)\micro [...]]]></description>
			<content:encoded><![CDATA[<p>Visual Studio 2010 beta特有の問題かもしれませんが、windows.hをincludeしたときに、以下のようなエラーが出る場合があります。</p>
<blockquote><p>
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\objidl.h(11280): error C2061: 構文エラー : 識別子 &#8216;__RPC__out_xcount_part&#8217;<br />
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\objidl.h(11281): error C2059: 構文エラー : &#8216;)&#8217;<br />
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\objidl.h(11281): fatal error C1903: 直前のエラーを修復できません。コンパイルを中止します。
</p></blockquote>
<div id="attachment_999" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bpsinc.jp/blog/wp-content/uploads/2010/01/ft01.png"><img src="http://www.bpsinc.jp/blog/wp-content/uploads/2010/01/ft01-300x79.png" alt="エラー" title="ft01" width="300" height="79" class="size-medium wp-image-999" /></a><p class="wp-caption-text">エラー</p></div>
<p>これは、objidl.hの読み込み順序が影響しているようです。</p>
<p>プロジェクトの設定→構成プロパティ→VC++ Directories→Include Directoriesで、objidl.hのある以下のディレクトリを追加すると直りました。</p>
<blockquote><p>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include</p></blockquote>
<div id="attachment_1000" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bpsinc.jp/blog/wp-content/uploads/2010/01/ft02.png"><img src="http://www.bpsinc.jp/blog/wp-content/uploads/2010/01/ft02-300x225.png" alt="Includeディレクトリの設定" title="ft02" width="300" height="225" class="size-medium wp-image-1000" /></a><p class="wp-caption-text">Includeディレクトリの設定</p></div>
<div id="attachment_1001" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bpsinc.jp/blog/wp-content/uploads/2010/01/ft03.png"><img src="http://www.bpsinc.jp/blog/wp-content/uploads/2010/01/ft03-300x248.png" alt="Includeディレクトリを追加" title="ft03" width="300" height="248" class="size-medium wp-image-1001" /></a><p class="wp-caption-text">Includeディレクトリを追加</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bpsinc.jp/blog/archives/998/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

