C Programming for Beginners #19 | command-line arguments in C
SyntaxPilot
0:00 / 0:00
C Programming for Beginners #19 | command-line arguments in C
0 просмотров · 1 дн. назад
SyntaxPilot
42 подписчика
0 просмотров · 1 дн. назад
C Programming for Beginners: Episode 19 of SyntaxPilot's free C full course, with real-life examples for every concept. command-line arguments in C.
In this video you'll learn:
• Why a program that asks with scanf can't run on its own
• What the command line and arguments are
• int main(int argc, char *argv[])
• argc counts, argv[0] is the program's name
• Arguments are strings: the char * error
• atoi: text to a number
• Missing argument: argv[1] is NULL and the program crashes
• Checking argc and printing a usage message
• Exit status: return 0 and return 1
• strtol: catching bad numbers
• Mini project: a bill splitter
Every concept starts with a real-life example, then an animation and notes, then live code in the SyntaxPilot online compiler.
Practice free in the SyntaxPilot compiler (nothing to install): https://syntaxpilot-learning-2026.web...
Detailed notes for this episode (code, outputs, practice): https://syntaxpilot-learning-2026.web...
Chapters
00:00 Welcome
00:19 Today's agenda
00:43 The program that keeps asking
02:31 The command line
03:17 argc and argv
05:55 Arguments are text: atoi
07:18 The missing-argument crash
08:09 Usage messages, exit status
09:49 strtol: catch bad numbers
11:04 Mini project: a bill splitter
12:49 Common mistakes
13:08 Quick quiz
13:31 Recap and homework
14:10 Next episode
Next episode: Multi-file programs and header files
Post your homework and quiz answer in the comments, and subscribe for the full basic-to-master playlist, free.
#CProgramming #CTutorial #SyntaxPilot