C in 100 Seconds: scanf — Read Numbers and Strings from the User | Episode 12

4views
00
2:15
T
Taught by Celeste AI - AI Coding Coach
View on YouTube
Description
scanf reads input from the user. You tell it the format, and it fills in your variable. Percent d reads a number, percent s reads a word. The key detail — scanf needs the memory address of where to store the value. For ints, that means the ampersand. For arrays, the name is already an address, so no ampersand needed. Student code: https://github.com/GoCelesteAI/c-in-100-seconds/tree/main/episode12 What You'll Learn: • scanf with %d to read an integer • scanf with %s to read a string • The ampersand — giving scanf the memory address • Why arrays don't need the ampersand • Piping input from the command line with echo Next: Episode 13 — fgets (the safer way to read strings) #c #programming #100seconds #learnc #scanf #userinput #stdin #ampersand #tutorial Tags c scanf, user input c, stdin c, ampersand c, scanf format specifier, c tutorial 2026, c beginner, 100 seconds, learn c, coding tutorial

Tags

c scanfuser input cstdin campersand cscanf format specifierc tutorial 2026c beginner100 secondslearn ccoding tutorial
Back to tutorials

Duration

2:15

Published

April 7, 2026

Added to Codegiz

April 8, 2026

Open in YouTube