Week 1 C

Watch the lecture

视频: https://www.youtube.com/watch?v=SlqjA04_dpk

第1周 C

C. 源代码。机器码。编译器。正确性、设计、风格。Visual Studio Code。语法高亮。转义序列。头文件。库。手册页。类型。条件语句。变量。循环。Linux。图形用户界面(GUI)。命令行界面(CLI)。常量。注释。伪代码。运算符。整数溢出。浮点数精度问题。

如何将源代码下载到 VS Code

  1. 登录 cs50.dev.

  2. In your terminal window, type

    wget https://cdn.cs50.net/2025/fall/lectures/1/src1.zip
    

    然后按 Enter in order to download a Zip file of lecture’s source code into your codespace.

  3. In your terminal window, type

    unzip src1.zip
    

    然后按 Enter to unzip (i.e., decompress) that Zip file.

  4. In your terminal window, type

    cd src1
    

    然后按 Enter in order to “change directory” into that src1 目录(即文件夹)。

  5. In your terminal window, type, e.g.,

    make hello0
    

    然后按 Enter in order to compile, e.g., hello0.c (源代码)生成 hello0 (机器码)。

  6. In your terminal window, type, e.g.,

    ./hello0
    

    然后按 Enter in order to run, e.g., hello0.