﻿
{"id":6380,"date":"2017-05-24T00:45:26","date_gmt":"2017-05-24T00:45:26","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=6380"},"modified":"2017-05-24T00:45:26","modified_gmt":"2017-05-24T00:45:26","slug":"cta-gostericipointer-gostericilerde-indexer-x","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/cta-gostericipointer-gostericilerde-indexer-x\/","title":{"rendered":"C#\u2019ta G\u00f6sterici(Pointer) \u2013 G\u00f6stericilerde Indexer &#8211; X"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>G\u00f6sterici yaz\u0131 dizimizde pointerlarla ilgili bir \u00e7ok i\u00e7erik \u00fczerinde makale ele alm\u0131\u015f bulunmaktay\u0131z. \u015eimdi ise yap\u0131sal olarak birden \u00e7ok i\u00e7eri\u011fi ilgilendiren bir konu \u00fczerinde, g\u00f6stericilerde indexer yap\u0131lar\u0131 \u00fczerinde konu\u015fuyor olaca\u011f\u0131z.<\/p>\n<p>Evet&#8230; \u0130\u00e7eri\u011fimizin ba\u015fl\u0131\u011f\u0131nda da de\u011findi\u011fimiz gibi g\u00f6stericiler \u00fczerinde indexer yap\u0131lar\u0131 kullan\u0131labilmektedir.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X.png\" alt=\"C#\u2019ta G\u00f6sterici(Pointer) \u2013 G\u00f6stericilerde Indexer - X\" width=\"256\" height=\"136\" class=\"aligncenter size-full wp-image-6382\" \/><\/a><br \/>\nYukar\u0131daki ekran g\u00f6r\u00fcnt\u00fcs\u00fcnden de g\u00f6rd\u00fc\u011f\u00fcn\u00fcz gibi &#8220;ipointer&#8221; isimli i\u015faret\u00e7iye indexer arac\u0131l\u0131\u011f\u0131yla &#8220;0&#8221; de\u011ferini verdi\u011fimizde ilgili de\u011fi\u015fkenin de\u011ferini bizlere getirmektedir. \u015eimdi gelin burada yap\u0131lan i\u015flemi ve neler olup bitti\u011fini ele alal\u0131m.<\/p>\n<p>G\u00f6stericiye indexer arac\u0131l\u0131\u011f\u0131yla verdi\u011fimiz &#8220;0&#8221; de\u011feri bize ilgili g\u00f6stericinin i\u015faret etti\u011fi bellek adresindeki de\u011feri getirmektedir. Peki indexera &#8220;1&#8221;, &#8220;3&#8221; veyahut &#8220;128&#8221; gibi herhangi bir de\u011fer verseydik ne olacakt\u0131 bakal\u0131m&#8230;<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-1.png\" alt=\"C#\u2019ta G\u00f6sterici(Pointer) \u2013 G\u00f6stericilerde Indexer - X\" width=\"271\" height=\"147\" class=\"aligncenter size-full wp-image-6385\" \/><\/a><br \/>\nG\u00f6rd\u00fc\u011f\u00fcn\u00fcz \u00fczere farkl\u0131 bir bellek adresindeki herhangi bir de\u011feri kar\u015f\u0131m\u0131za getirmi\u015f bulunmaktad\u0131r. &#8220;<strong><em>Peki neye g\u00f6re bu i\u015flemi yapmaktad\u0131r?<\/em><\/strong>&#8221; diye sorarsan\u0131z e\u011fer <a href=\"http:\/\/www.gencayyildiz.com\/blog\/cta-gostericipointer-gostericilerde-aritmatik-islemler-vi\/\" target=\"_blank\">G\u00f6stericilerde Aritmatik \u0130\u015flemler<\/a> ba\u015fl\u0131kl\u0131 makalemizde ne konu\u015ftuysak ayn\u0131 i\u015flevde bir aritmatik mant\u0131k ortaya koymaktad\u0131r&#8230;<\/p>\n<p>Yani \u015f\u00f6yle ki;<br \/>\nPointera indexer arac\u0131l\u0131\u011f\u0131yla verilen de\u011fer; pointer\u0131n i\u015faretledi\u011fi bellek adresini, pointer\u0131n tipinin byte de\u011feri kadar artt\u0131rmaktad\u0131r. Yani &#8220;ipointer&#8221; isimli pointer\u0131m\u0131z int tipinden oldu\u011fu i\u00e7in &#8220;ipointer[0]&#8221; komutu &#8220;*(ipointer + 0 * 4)&#8221; mant\u0131\u011f\u0131yla i\u015flemektedir ve 0 byte artarak do\u011fal olarak ilk verilen de\u011fi\u015fkenin bellek adresini i\u015faret etmektedir. Benzer \u015fekilde &#8220;ipointer[10] deyimi ise &#8220;*(ipointer + 10 * 4)&#8221; \u015feklinde i\u015flenecektir ve i\u015faretledi\u011fi bellek adresi 40 byte artt\u0131r\u0131lacakt\u0131r. Yani bildi\u011finiz g\u00f6stericilerde aritmatik i\u015flemleri indexer ile ger\u00e7ekle\u015ftirmekteyiz. Olay\u0131 daha iyi g\u00f6zler \u00f6n\u00fcne getirebilmek i\u00e7in a\u015fa\u011f\u0131daki ekran g\u00f6r\u00fcnt\u00fcs\u00fcn\u00fc inceleyiniz&#8230;<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-2.png\" alt=\"C#\u2019ta G\u00f6sterici(Pointer) \u2013 G\u00f6stericilerde Indexer - X\" width=\"497\" height=\"195\" class=\"aligncenter size-full wp-image-6392\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-2.png 497w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-2-300x118.png 300w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><\/a><\/p>\n<p>Bu arada dikkat ederseniz e\u011fer pointerlarda kulland\u0131\u011f\u0131m\u0131z indexer yap\u0131lar\u0131 pointer\u0131n direkt olarak i\u015faret etti\u011fi bellek adresindeki veriyi getirmektedir. Haliyle bu yukar\u0131da yapm\u0131\u015f oldu\u011fumuz i\u015flemi a\u015fa\u011f\u0131daki \u015femayada benzetebiliriz.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-3.png\" alt=\"C#\u2019ta G\u00f6sterici(Pointer) \u2013 G\u00f6stericilerde Indexer - X\" width=\"201\" height=\"203\" class=\"aligncenter size-full wp-image-6394\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-3.png 201w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-3-150x150.png 150w\" sizes=\"auto, (max-width: 201px) 100vw, 201px\" \/><\/a><\/p>\n<p>Haliyle bu mant\u0131\u011f\u0131 test etmek i\u00e7in a\u015fa\u011f\u0131da ele ald\u0131\u011f\u0131m\u0131z kod blo\u011fu ve \u00e7\u0131kt\u0131s\u0131na g\u00f6z at\u0131n\u0131z.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-4.png\" alt=\"C#\u2019ta G\u00f6sterici(Pointer) \u2013 G\u00f6stericilerde Indexer - X\" width=\"662\" height=\"231\" class=\"aligncenter size-full wp-image-6398\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-4.png 662w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-4-300x105.png 300w\" sizes=\"auto, (max-width: 662px) 100vw, 662px\" \/><\/a><br \/>\nYani tekrardan \u00f6zetlemek gerekirse bir pointera direkt olarak yap\u0131lan aritmatik i\u015flem sonucunda i\u015faretlenen bellek adresinin de\u011ferini elde etmeyle(<em>*(ipointer + i)<\/em>), indexer kullanarak verilen de\u011fere kar\u015f\u0131l\u0131k hangi bellek adresine denk geliyorsa oradaki de\u011feri elde ettirmesi(<em>ipointer[i]<\/em>) ayn\u0131 kap\u0131ya \u00e7\u0131kmaktad\u0131r.<\/p>\n<p>O halde \u015f\u00f6yle bir genellemeye varabiliriz&#8230;<\/p>\n<blockquote><p>\n<strong><em>&#8220;ipointer[i]&#8221; ilgili bellek adresindeki de\u011feri\/nesneyi belirtirken, &#8220;(ipointer + i)&#8221; ilgili bellek adresini belirtir. &#8220;ipointer[i]&#8221; direkt de\u011feri g\u00f6nderdi\u011fi i\u00e7in de\u011fere ula\u015fmak ayr\u0131 bir i\u015flem gerektirmemektedir lakin &#8220;(ipointer + i)&#8221; deyimi bellek adresini belirtti\u011fi i\u00e7in de\u011fere ula\u015fmak * operat\u00f6r\u00fcn\u00fc gerektirmektedir. *(ipointer + i) gibi&#8230;<\/em><\/strong>\n<\/p><\/blockquote>\n<p>G\u00f6stericilerde indexer yap\u0131lar\u0131n\u0131 dizi i\u015flemlerinde de kullanmaktay\u0131z. <a href=\"http:\/\/www.gencayyildiz.com\/blog\/cta-gostericipointer-gostericiler-ile-dizi-islemleri-viii\/\" target=\"_blank\">G\u00f6stericiler \u0130le Dizi \u0130\u015flemleri<\/a> ve <a href=\"http:\/\/www.gencayyildiz.com\/blog\/cta-gostericipointer-stackalloc-anahtar-sozcugu-ix\/\" target=\"_blank\">stackalloc Anahtar S\u00f6zc\u00fc\u011f\u00fc<\/a> ba\u015fl\u0131kl\u0131 makalelerde g\u00f6stericiler ile dizilerin nas\u0131l kullan\u0131ld\u0131\u011f\u0131na detayl\u0131ca de\u011finmi\u015ftik.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-5.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-5.png\" alt=\"C#\u2019ta G\u00f6sterici(Pointer) \u2013 G\u00f6stericilerde Indexer - X\" width=\"401\" height=\"119\" class=\"aligncenter size-full wp-image-6407\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-5.png 401w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-5-300x89.png 300w\" sizes=\"auto, (max-width: 401px) 100vw, 401px\" \/><\/a><br \/>\nHaliyle yukar\u0131daki kullan\u0131m\u0131 indexer ile a\u015fa\u011f\u0131daki gibide ger\u00e7ekle\u015ftirebiliriz.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-6.png\" alt=\"C#\u2019ta G\u00f6sterici(Pointer) \u2013 G\u00f6stericilerde Indexer - X\" width=\"397\" height=\"119\" class=\"aligncenter size-full wp-image-6408\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-6.png 397w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/05\/C\u2019ta-G\u00f6stericiPointer-\u2013-G\u00f6stericilerde-Indexer-X-6-300x90.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/a><\/p>\n<p>Evet arkada\u015flar&#8230; Bir yaz\u0131m\u0131z\u0131n daha sonuna gelmi\u015f bulunmaktay\u0131z. Sonraki yaz\u0131m\u0131zda struct t\u00fcr\u00fcnden g\u00f6stericiler \u00fczerine detayl\u0131 bir i\u00e7erik olu\u015fturarak ilgili yaz\u0131 dizimizede son vermeyi d\u00fc\u015f\u00fcn\u00fcyorum.<\/p>\n<p>\u015eimdilik g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, G\u00f6sterici yaz\u0131 dizimizde pointerlarla ilgili bir \u00e7ok i\u00e7erik \u00fczerinde makale ele alm\u0131\u015f bulunmaktay\u0131z. \u015eimdi ise yap\u0131sal olarak birden \u00e7ok i\u00e7eri\u011fi ilgilendiren bir konu \u00fczerinde, g\u00f6stericilerde indexer yap\u0131lar\u0131 \u00fczerinde konu\u015fuyor olaca\u011f\u0131z. Evet&#8230; \u0130\u00e7eri\u011fimizin ba\u015fl\u0131\u011f\u0131nda&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":3014,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[1784,1808,1746,1809,1807],"class_list":["post-6380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-sharp-c","tag-c-gostericiler","tag-c-gostericiler-indexer","tag-c-pointer","tag-c-pointer-indexer","tag-c-pointerlar"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/6380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=6380"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/6380\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/3014"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=6380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=6380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=6380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}