Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sicherheitslücken (CVE)CVE-2024-0244 – A heap buffer overflow in the Canon MF753Cdw printer(23.09.2026 um 21:03 Uhr)
Malware / Trojaner / VirenNew Galago Ransomware Operation Emerges With Links to Panzer Extortion Group(24.09.2026 um 08:06 Uhr)
Sicherheitslücken (CVE)Hackers Exploit Check Point VPN RCE and Management Zero-Day in Attacks(24.09.2026 um 11:41 Uhr)
Sicherheitslücken (CVE)Check Point Fixes a New Actively Exploited Critical Security Flaw(22.09.2026 um 21:31 Uhr)
Sicherheitslücken (CVE)CVE-2026-87902: how close is your WordPress to remote code execution?(23.09.2026 um 09:36 Uhr)
Sicherheitslücken (CVE)ShinyHunters claims FBI breach after alleged PeopleSoft zero-day attack(23.09.2026 um 15:56 Uhr)
Sicherheitslücken (CVE)CVE-2024-0244 – A heap buffer overflow in the Canon MF753Cdw printer(23.09.2026 um 21:03 Uhr)
Malware / Trojaner / VirenNew Galago Ransomware Operation Emerges With Links to Panzer Extortion Group(24.09.2026 um 08:06 Uhr)
Sicherheitslücken (CVE)Hackers Exploit Check Point VPN RCE and Management Zero-Day in Attacks(24.09.2026 um 11:41 Uhr)
Sicherheitslücken (CVE)Check Point Fixes a New Actively Exploited Critical Security Flaw(22.09.2026 um 21:31 Uhr)
Sicherheitslücken (CVE)CVE-2026-87902: how close is your WordPress to remote code execution?(23.09.2026 um 09:36 Uhr)
Sicherheitslücken (CVE)ShinyHunters claims FBI breach after alleged PeopleSoft zero-day attack(23.09.2026 um 15:56 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

printf() and scanf() in C: Understanding Input and Output

One of the first things every C programmer learns is how to interact with users. A program that cannot receive input or display output is not very useful. In C, this interaction is handled primarily by two standard library…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

One of the first things every C programmer learns is how to interact with users. A program that cannot receive input or display output is not very useful.



In C, this interaction is handled primarily by two standard library functions:





  • printf() for output


  • scanf() for input



Let's see how they work and why they are so important.






What is printf()?



printf() stands for Print Formatted.



It is used to display output on the screen.




#include <stdio.h>

int main()
{
printf("Hello, World!");
return 0;
}






Output:




Hello, World!






The function can also display variable values using format specifiers.




int age = 23;

printf("Age = %d", age);






Output:




Age = 23






Here, %d tells printf() to display an integer.






What is scanf()?



scanf() stands for Scan Formatted.



It reads input from the keyboard and stores it in variables.




int age;

scanf("%d", &age);






The & operator is important because scanf() needs the memory address where the value should be stored.



Complete example:




#include <stdio.h>

int main()
{
int age;

printf("Enter your age: ");
scanf("%d", &age);

printf("You entered: %d", age);

return 0;
}









Common Format Specifiers
































Specifier Type
%d int
%f float
%lf double
%c char
%s string


Example:




float salary = 45000.50;
char grade = 'A';

printf("%f\n", salary);
printf("%c\n", grade);









A Common Beginner Mistake



Many beginners forget the & operator.



Incorrect:




scanf("%d", age);






Typical compiler warning:




warning: format '%d' expects argument of type 'int *'






Correct:




scanf("%d", &age);









How scanf() and printf() Work Internally



A useful mental model is:




Keyboard

scanf()

Memory

printf()

Monitor






When a user enters a value:





  1. scanf() reads the input.

  2. The value is stored in memory.


  3. printf() reads the value from memory.

  4. The result is displayed on the screen.



Understanding this flow makes later topics such as pointers and memory management much easier.






Key Takeaways





  • printf() displays output.


  • scanf() accepts input.

  • Format specifiers determine how data is interpreted.

  • The & operator provides a memory address.

  • These functions are fundamental to almost every beginner C program.

SOC Incident Playbook: Vulnerability Remediation & Verification
title: Detect Exploitation - printf() and scanf() in C: Understanding Input and Output
id: da8a8de0-d76c-45d2-a9c2-bafc9ce389ab
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "printf() and scanf() in C: Und" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich printf() and scanf() in C: Understanding.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten printf() and scanf() in C: Understanding Input and Output

Thematisch verwandte Begriffe: printf, scanf, Understanding, Input · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

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-97360 | HFS2 version 2.4.0 and earlier contains an unauthenticated arbitrary fil…
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 TTP ⏱️ 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