Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungFliproom: a room changeover is a content problem(21.09.2026 um 04:10 Uhr)
Sichere ProgrammierungNova Adiutrix: My Second Agent Built My First Project's To-Do List(21.09.2026 um 04:11 Uhr)
IT Security ToolsAntiphishing v35456910988(21.09.2026 um 02:35 Uhr)
IT Security Toolsbrave-browser v1.98.12(21.09.2026 um 03:35 Uhr)
Sichere ProgrammierungFliproom: a room changeover is a content problem(21.09.2026 um 04:10 Uhr)
Sichere ProgrammierungNova Adiutrix: My Second Agent Built My First Project's To-Do List(21.09.2026 um 04:11 Uhr)
IT Security ToolsAntiphishing v35456910988(21.09.2026 um 02:35 Uhr)
IT Security Toolsbrave-browser v1.98.12(21.09.2026 um 03:35 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Pointers in C programming.

Reagiere als Erste:r — dein Feedback zählt!

Pointer in c allow us to work directly with the computer memory.

Memory Addresses

In c programming whenever we declare a variable a space will be allocated in the memory for the variable and C allows us to access the address of the variable. We use & with variable name to access the memory address.
Example:

int main() {
    int age = 25;
    printf("%p", &age);
    return 0;
}

Output:

0x7ffcad58272c

The format specifier %p(pointers) and & is used to get the memory address where 25 is located.

scanf("%d", &age);- with scanf we are instructing the compiler to store the input value at the memory address specified by this &age.

Pointer Variable

The pointer variable stores the memory addresses of the available value.
Example: int* ptr;

Assigning value(memory address) to a pointer variable

int main() {
    int age = 25;
    printf("%p", &age);

    int* ptr = &age; //assigned value.

    printf("\n%p", ptr);
    return 0;
}

Access value using pointer
Here we are trying to access the value of a variable using pointer variable.

int main() {
    int age = 25;

    int* ptr = &age; 

    printf("Address: %p\n", ptr);

    printf("Value: %d", *ptr); 

    return 0;
}

printf("Value: %d", *ptr);- it gives the value stored in a memory address.

Change value using pointer

int main() {
    int age = 25;

    int* ptr = &age; 

    *ptr = 31; 

    printf("%d", age);

    return 0;
}

In the above code, the initially assigned value is 25.
*ptr = 31; - it assigns a new value pointed by the ptr variable.
printf("%d", age); - now the value is changes to 31. because it points directly to the address and change the value to 31.

int* ptr = 32; (Invalid)
ptr is a pointer and it can only store memory address. And if we try to assign a value or number to it then it will become invalid.

*ptr = &number; (invalid)
*ptr stores the value and if we try to assign a memory address then it becomes invalid.

ptr = &number; (valid) - assigning address.

*ptr = number; (valid) - assigning value.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Pointers in C programming.

Thematisch verwandte Begriffe: Pointers, programming · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93974 | A flaw has been found in SourceCodester Online Reviewer Management Syste…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick