# 1.20 Pointers

C++'da işaretçiler, bellekteki bir değişkenin adresini tutan değişkenlerdir. İşaretçiler, bellek yönetimini optimize etmek, fonksiyonlara parametre olarak adres göndererek değişkenleri değiştirmek ve dinamik bellek tahsisi gibi işlemler için kullanılır.

**İşaretçi Oluşturma**

Bir işaretçi oluşturmak için, değişkenin tipinin ardından `*` işaretini kullanarak işaretçiyi tanımlarsınız.

**Örnek: İşaretçi Oluşturma**

```cpp
#include <iostream>
using namespace std;

int main() {
    int value = 42;           // Değişken tanımı
    int *ptr = &value;       // İşaretçi oluşturma ve adresi alma

    cout << "Değişkenin Değeri: " << value << endl; // 42
    cout << "Değişkenin Bellek Adresi: " << &value << endl; // Bellek adresi
    cout << "İşaretçinin Göstermiş Olduğu Değer: " << *ptr << endl; // 42

    return 0;
}
```

**Dereference (Dereferencing)**

Dereference, bir işaretçinin gösterdiği adresin içeriğini almak anlamına gelir. Bunun için `*` operatörü kullanılır.

**Örnek: Dereferencing**

```cpp
#include <iostream>
using namespace std;

int main() {
    int number = 100;          // Değişken tanımı
    int *ptr = &number;       // İşaretçi oluşturma

    cout << "İşaretçinin Göstermiş Olduğu Değer: " << *ptr << endl; // 100

    // Dereferencing ile değeri değiştirme
    *ptr = 200;

    cout << "Yeni Değer: " << number << endl; // 200

    return 0;
}
```

Yukarıdaki örnekte, işaretçi üzerinden dereferencing ile `number` değişkeninin değeri değiştirilmiştir.

**İşaretçileri Değiştirme**

İşaretçilerin kendisi de başka bir adresi gösterecek şekilde değiştirilebilir.

**Örnek: İşaretçiyi Değiştirme**

```cpp
#include <iostream>
using namespace std;

int main() {
    int num1 = 10;
    int num2 = 20;
    int *ptr = &num1;  // ptr num1'in adresini tutuyor

    cout << "ptr'nin Göstermiş Olduğu Değer: " << *ptr << endl; // 10

    ptr = &num2;       // ptr'yi num2'nin adresine yönlendirme

    cout << "ptr'nin Göstermiş Olduğu Yeni Değer: " << *ptr << endl; // 20

    return 0;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yavuzlar.org/egitim/c-plus-plus/2.0-fonksiyonlar/1.20-pointers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
