<?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>Cloudscape&#039;s Blog &#187; C++</title>
	<atom:link href="http://cloudscape.pe.kr/wp/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://cloudscape.pe.kr/wp</link>
	<description>Wer rastet, der rostet.</description>
	<lastBuildDate>Mon, 06 Feb 2012 10:35:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Reference</title>
		<link>http://cloudscape.pe.kr/wp/reference/</link>
		<comments>http://cloudscape.pe.kr/wp/reference/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 23:21:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://cloudscape.pe.kr/wp/?p=1260</guid>
		<description><![CDATA[C++을 자주 쓸 일이 없어 그런지 아직도 이따금 헷갈리는 reference. 몇가지만 적어두자. ... // quoted from winapi.co.kr void plusref2(int &#038;a); void main() { int i=5; plusref2(i); printf("result = %d\n", i); } void plusref2(int &#038;a) { a=a+1; } 호출부가 call-by-value와 똑같다. (이것때문에 call-by-value 함수와 헷갈리기도 한다) 함수 원형이 plusref2(int &#038;a) 식으로 레퍼런스를 받는다. 함수 본체 내에서는 [...]]]></description>
			<content:encoded><![CDATA[<p>C++을 자주 쓸 일이 없어 그런지 아직도 이따금 헷갈리는 reference. 몇가지만 적어두자.</p>
<pre class="brush: cpp; collapse: true;">
...
// quoted from winapi.co.kr

void plusref2(int &#038;a);

void main()
{
    int i=5;
    plusref2(i);
    printf("result = %d\n", i);
}

void plusref2(int &#038;a)
{
     a=a+1;
}
</pre>
<ul>
<li>호출부가 call-by-value와 똑같다. (이것때문에 call-by-value 함수와 헷갈리기도 한다)</li>
<li>함수 원형이 plusref2(int &#038;a) 식으로 레퍼런스를 받는다. 함수 본체 내에서는 call-by-value로 받은 마냥 전달받은 인수를 사용한다. 예를 들어 구조체를 받으면 -> 로 억세스하는 것이 아니라 . 으로 한다.</li>
</ul>
<p>아래는 구조체 호출의 예이다.</p>
<pre class="brush: cpp;">
...
// quoted from winapi.co.kr

struct tag_Friend {
     char Name[10];
     int Age;
     double Height;
};

void OutFriend(tag_Friend F);
void OutFriendPtr(tag_Friend *F);
void OutFriendRef(tag_Friend &#038;F);

void main()
{
     tag_Friend Friend={"Gavin Finlay", 24, 181.2};
     OutFriend(Friend);
     OutFriendPtr(&#038;Friend);
     OutFriendRef(Friend);
}

void OutFriend(tag_Friend F)
{
     printf("이름=%s, 나이=%d, 키=%.1f\n", F.Name, F.Age, F.Height);
}

void OutFriendPtr(tag_Friend *F)
{
     printf("이름=%s, 나이=%d, 키=%.1f\n", F->Name, F->Age, F->Height);
}

void OutFriendRef(tag_Friend &#038;F)
{
     printf("이름=%s, 나이=%d, 키=%.1f\n", F.Name, F.Age, F.Height);
}
</pre>
<p>STL에서 배열의 값을 find를 써서 찾을 때는 다음과 같다.</p>
<pre class="brush: cpp; collapse: false;">
...
int a[5] = {12, 3, 849, 2, 3890};
int *ptr = find(&#038;a[0], &#038;a[5], 849);

assert(*ptr == 849 &#038;&#038; *(ptr + 1) == 2);

list&lt;int&gt; list1(&#038;a[0], &#038;a[5]);
list&lt;int&gt;::iterator i = find(list1.begin(), list1.end(), 849);
</pre>
<p>find의 first, last 인자와 리턴이 같은 타입의 iterator라는 것을 고려하면 배열에 대해 find를 사용할 때 int *prt = find(&#038;a[0], &#038;a[5], 849); 로 했는지 이해가 간다. (&#038;a[0]는 a[0], 즉 첫번째 값의 주소)가</p>
]]></content:encoded>
			<wfw:commentRss>http://cloudscape.pe.kr/wp/reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C/C++ Coding Style</title>
		<link>http://cloudscape.pe.kr/wp/c-cplusplus-coding-style/</link>
		<comments>http://cloudscape.pe.kr/wp/c-cplusplus-coding-style/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 11:21:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Coding Style]]></category>

		<guid isPermaLink="false">http://cloudscape.pe.kr/wp/cc-coding-style/</guid>
		<description><![CDATA[늘 C/C++ 코딩 시 갈등 하게 만드는 코딩 스타일. 정말 다양한 스타일이 있는데 그 중 좋아하는 순서대로 몇 가지만 추리면, Recommended C Style and Coding Standards. 깔끔하게 아주 잘 정리되어 있다. Linux Kernel Coding Style. 상단에 버젼 별로 문서를 볼 수 있게 하였다. 거의 차이는 없다만. GNU Coding Standards. 상기 문서와 비슷. Google C++ Style [...]]]></description>
			<content:encoded><![CDATA[<p>늘 C/C++ 코딩 시 갈등 하게 만드는 코딩 스타일. 정말 다양한 스타일이 있는데 그 중 좋아하는 순서대로 몇 가지만 추리면,</p>
<ul>
<li><a href="http://www.psgd.org/paul/docs/cstyle/cstyle.htm">Recommended C Style and Coding Standards</a>. 깔끔하게 아주 잘 정리되어 있다. </li>
<li><a href="http://lxr.linux.no/#linux+v2.6.31/Documentation/CodingStyle">Linux Kernel Coding Style</a>. 상단에 버젼 별로 문서를 볼 수 있게 하였다. 거의 차이는 없다만. </li>
<li><a href="http://www.gnu.org/prep/standards/standards.html">GNU Coding Standards</a>. 상기 문서와 비슷.</li>
<li><a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml">Google C++ Style Guide</a>. 비주얼 보다는 가이드에 가깝다. <a href="https://developer.mozilla.org/En/Mozilla_Coding_Style_Guide">Mozilla</a> 것도 그렇고. </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://cloudscape.pe.kr/wp/c-cplusplus-coding-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TIOBE Programming Community Index</title>
		<link>http://cloudscape.pe.kr/wp/tiobe-programming-community-index/</link>
		<comments>http://cloudscape.pe.kr/wp/tiobe-programming-community-index/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 13:22:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[ABAP]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://cloudscape.pe.kr/wp/?p=156</guid>
		<description><![CDATA[TIOBE Programming Community Index 가기 어떤 Programming Language가 가장 인기있는가를 보여주는 index 입니다. 제가 매일 사용하는 ABAP의 경우 순위가 가장 많이 떨어졌네요. 20위. 얼마전 시작한 Haskell의 순위는 36위. 헐&#8230; 하지만 저에겐 언제나 흥미로운 언어인 C++와 Python은 각각 3위와 6위를 차지하고 있네요. all-time-favorite인 C는 부동의 2위를 차지하고 있고.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html">TIOBE Programming Community Index 가기</a></p>
<p>어떤 Programming Language가 가장 인기있는가를 보여주는 index 입니다.</p>
<p>제가 매일 사용하는 ABAP의 경우 순위가 가장 많이 떨어졌네요. 20위.<br />
얼마전 시작한 Haskell의 순위는 36위. 헐&#8230;</p>
<p>하지만 저에겐 언제나 흥미로운 언어인 C++와 Python은 각각 3위와 6위를 차지하고 있네요.<br />
all-time-favorite인 C는 부동의 2위를 차지하고 있고.</p>
]]></content:encoded>
			<wfw:commentRss>http://cloudscape.pe.kr/wp/tiobe-programming-community-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

