<?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>kelebek@PIS-ii:~$ &#187; c/c++</title>
	<atom:link href="http://blog.yollu.com/tag/cc/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yollu.com</link>
	<description>Aşkın Yollu&#039;nun Web Günlüğü</description>
	<lastBuildDate>Tue, 17 Aug 2010 00:28:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>C ile Nesne Yaratmak</title>
		<link>http://blog.yollu.com/2010/04/27/c-ile-nesne-yaratmak/</link>
		<comments>http://blog.yollu.com/2010/04/27/c-ile-nesne-yaratmak/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 01:08:48 +0000</pubDate>
		<dc:creator>Aşkın Yollu</dc:creator>
				<category><![CDATA[Gezegen]]></category>
		<category><![CDATA[Programlama]]></category>
		<category><![CDATA[c/c++]]></category>
		<category><![CDATA[Nesne]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://blog.yollu.com/?p=693</guid>
		<description><![CDATA[Evet kışkırtıcı bir başlık attım Aslında yapacağımız olay bir structı nesne gibi kullanmak. Buna benzer bir kodu yıllar önce görmüştüm. O günden bu güne sürekli böyle bir şeyi nasıl yaparım diye araştırdım. Anca bugün çözebildim olayı Kodu aşağıda yorum satırıyla beraber veriyorum. Yorumlarda gerekli açıklamaları yaptım. Bu yazıyla C-3PO nun ne lakası var diyebilirsiniz. C [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yollu.com/wp-content/uploads/2010/04/c3po.jpg" alt="" title="C-3PO" width="143" height="150" align="left" />Evet kışkırtıcı bir başlık attım <img src='http://blog.yollu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Aslında yapacağımız olay bir structı nesne gibi kullanmak. Buna benzer bir kodu yıllar önce görmüştüm. O günden bu güne sürekli böyle bir şeyi nasıl yaparım diye araştırdım. Anca bugün çözebildim olayı <img src='http://blog.yollu.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Kodu aşağıda yorum satırıyla beraber veriyorum. Yorumlarda gerekli açıklamaları yaptım.</p>
<p>Bu yazıyla C-3PO nun ne lakası var diyebilirsiniz. C ile resim ararken karşıma bu çıktı, bende boş durmasın dedim <img src='http://blog.yollu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="c"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/*</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;* Sınıfımızı yaratıyoruz</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;*/</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">struct</span> _myobject <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #808080; font-style: italic;">// alt alanlar</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #993333;">int</span> a, b;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #808080; font-style: italic;">/*</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;  * Metod</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;  * Burada fonksiyon pointerı tanımlıyoruz</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;  */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #993333;">int</span> <span style="color: #66cc66;">&#40;</span>*add<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">struct</span> _myobject*<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// struct ön ekinden kurtuluyoruz</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">typedef</span> <span style="color: #993333;">struct</span> _myobject MyObject;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/*</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;* Asıl işi yapacak fonksiyonu tanımlıyoruz</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;* MyObject structını parametre olarak alıyor</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;*/</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">int</span> realAdd<span style="color: #66cc66;">&#40;</span>MyObject* a<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #b1b100;">return</span> a-&gt;a + a-&gt;b;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">int</span> main <span style="color: #66cc66;">&#40;</span> <span style="color: #993333;">void</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #808080; font-style: italic;">/*</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;  * Nesnemizi oluşturuyoruz.</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;  * add pointerına fonksiyonu atıyoruz</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;  */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  MyObject mo = <span style="color: #66cc66;">&#123;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">2</span>, realAdd<span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;A + B = %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, mo.<span style="color: #202020;">add</span><span style="color: #66cc66;">&#40;</span>&amp;mo<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></pre>
<p>Kodun başına stdio.h headerını eklemekte fayda var. WP sıkıntı çıkarttığı için silmek zorunda kaldım. Kodun düzgün halini <a href="http://github.com/askin/misc/raw/master/fun/struct-function.c" target="_blank">burada</a> bulabilirsiniz.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yollu.com/2010/04/27/c-ile-nesne-yaratmak/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C ile Komut Satırı Argumanları ve Parametreleri</title>
		<link>http://blog.yollu.com/2009/07/10/c-ile-komut-satiri-argumanlari-ve-parametreleri/</link>
		<comments>http://blog.yollu.com/2009/07/10/c-ile-komut-satiri-argumanlari-ve-parametreleri/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:01:29 +0000</pubDate>
		<dc:creator>Aşkın Yollu</dc:creator>
				<category><![CDATA[Gezegen]]></category>
		<category><![CDATA[Programlama]]></category>
		<category><![CDATA[c/c++]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.yollu.com/?p=323</guid>
		<description><![CDATA[Komut satırı programları -h yada --help gibi parametreler alırlar. Bu alınan parametrelerin kolay kullanılması için getopt adında bir kütüphane yaratılmış. Bu kütüphane kullanlanılarak çok rahat böyle programlar yazılabilir. Bende bunun için küçük bir örnek yazdım. Örnek]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yollu.com/wp-content/uploads/2009/07/gnome-terminal.png" alt="Terminal" title="Terminal" width="96" height="96" class="alignleft size-full wp-image-350" />Komut satırı programları -h yada --help gibi parametreler alırlar. Bu alınan parametrelerin kolay kullanılması için <em>getopt</em> adında bir kütüphane yaratılmış. Bu kütüphane kullanlanılarak çok rahat böyle programlar yazılabilir.<br />
Bende bunun için küçük bir örnek yazdım.<br />
<a href='http://blog.yollu.com/wp-content/uploads/2009/07/clexmp.c' target="_blank">Örnek</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yollu.com/2009/07/10/c-ile-komut-satiri-argumanlari-ve-parametreleri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
