
MIT-6.087学习记录
文章平均质量分 90
MIT-6.087学习记录
酸豆角姑娘
闻道有先后。
展开
-
Lecture 4 - More control flow. Input and output.
文章目录课程知识点课程知识点1. goto语句Error Handler: 像C++和或者Java,当遇到error的时候它们会提供exception接口。C语言中可以通过goto语句来实现从多重判断里直接退出到error handler里。但是一般我们不用goto语句,首先它不利于debug,其次所有用goto语句写的code我们都可以用别的if else之类的来替代。在我接触到的产品code里,因为项目非常庞大,确实在code style里面明确声明不能使用goto语句,以防止后期代码维护.原创 2022-05-02 19:57:02 · 614 阅读 · 0 评论 -
Lecture 3 - Control flow. Functions and modular programming. Variable scope. Static and global varia
文章目录课程知识点课后练习课程知识点1. extern关键字Enables access/modifying of global variable from other source files2. 多个.c文件一起gcc编译 e.g. gcc -g -O0 -Wall diophant.c euclid.c -o diophant.o3. variable scope 变量作用域variables declared outside of a function have global.原创 2022-05-01 19:14:58 · 404 阅读 · 0 评论 -
Lecture 2 - Variables and datatypes, operators
文章目录课程知识点课后练习课程知识点signed 和unsigned的区别【疑问】如果它们只是表示范围的不同,只体现在算术表达式上的差别的话,为什么char也有unsigned的格式啊?大端和小端的问题Big endian: the most significant bits(MSBs) occupy the lower address.网络中常常使用大端,所以它也被成为网络orderLittle endian: the least significant bits(LSBs) .原创 2022-04-30 17:03:07 · 440 阅读 · 0 评论 -
Lecture 1 - Introduction. Writing, compiling, and debugging C programs. Hello world.
课程重点速记C is a low-level language. low-level is also known as machinelevel language.gdb on MAC M1 gdb is not support, but you can use lldb.strings stored as character arraynull-terminated (last character in array is ‘\0’ null) not writen explici原创 2022-04-17 22:09:54 · 525 阅读 · 0 评论