filmov
tv
CS50 Week 2: Command Line, Compilation & Cipher | #CS50 #ComputerScience #CodingJourney

Показать описание
In Week 2 of Harvard’s CS50, I dove deeper into C programming — and things started to click.
The lecture began with arrays and strings, but what really stood out were topics like command-line arguments, the four steps of compilation, and exit statuses.
Using int argc, string argv[], I learned how to accept user input directly from the terminal — no get_string needed. Then came something surprisingly fun: making my terminal talk. Seriously, using commands like cowsay -f duck quack or cowsay -f dragon RAWR, it felt like coding met comedy.
We also uncovered why strings use double quotes in C — it's because they automatically add a null character \0 at the end. That’s how C knows where the string stops.
Another cool trick? You can check if a program ran successfully with echo $? — where 0 means success.
To wrap it up, the week's problem set involves building either a Caesar or Substitution cipher. It's the first real challenge that feels like solving a puzzle with code.
🧠 Concepts I learned:
Command-line arguments (argc, argv)
Exit status (return 0, echo $?)
Compilation process (preprocessing → compiling → assembling → linking)
Terminal fun with cowsay
String termination with \0
🔐 Problem Set: Build a Caesar or Substitution Cipher
No capes. Just code.
If you're following the CS50 journey or learning to code yourself, subscribe for more calm, clear breakdowns every week.
#CS50 #LearnToCode #ComputerScience #CProgramming #CodingJourney
The lecture began with arrays and strings, but what really stood out were topics like command-line arguments, the four steps of compilation, and exit statuses.
Using int argc, string argv[], I learned how to accept user input directly from the terminal — no get_string needed. Then came something surprisingly fun: making my terminal talk. Seriously, using commands like cowsay -f duck quack or cowsay -f dragon RAWR, it felt like coding met comedy.
We also uncovered why strings use double quotes in C — it's because they automatically add a null character \0 at the end. That’s how C knows where the string stops.
Another cool trick? You can check if a program ran successfully with echo $? — where 0 means success.
To wrap it up, the week's problem set involves building either a Caesar or Substitution cipher. It's the first real challenge that feels like solving a puzzle with code.
🧠 Concepts I learned:
Command-line arguments (argc, argv)
Exit status (return 0, echo $?)
Compilation process (preprocessing → compiling → assembling → linking)
Terminal fun with cowsay
String termination with \0
🔐 Problem Set: Build a Caesar or Substitution Cipher
No capes. Just code.
If you're following the CS50 journey or learning to code yourself, subscribe for more calm, clear breakdowns every week.
#CS50 #LearnToCode #ComputerScience #CProgramming #CodingJourney