Programming abstractions in C阅读笔记:p127-p129
《Programming Abstractions In C》学习第51天,p127-p129,总结如下:
一、技术总结
1. string library
掌握常用函数如strlen,strcpy用法。
2.buffer overflow(缓冲区溢出)
(1)什么是buffer?
p129,Arrays that are preallocated and later use as a repository for data called buffers。
(2)什么是缓冲区溢出?
p129,Writing data past the end of an buffer is a common programming error called buffer overflow。
//buffer overflow示例
char *src = "Hello";
char dst[1]; // dst称为buffer
strcpy(dst, src); // 该操作会导致buffer overflow问题
书中只是做一个简单的说明,具体可参考:
(1) wikipedia, Buffer overflow: https://en.wikipedia.org/wiki/Buffer_overflow
二、英语总结
1.“The function will go ahead and copy characters right on past the end of the buffer.”语法分析
答:这里的应该是The function will go ahead and (copy characters right) (on past the end of the buffer),这句话有几个要注意的地方:
(1)right
adv. exactly or all the way(完全地),指的是“一直复制/继续复制”。在原文中也有一点"强调"的意思--虽然字符串已经超过了缓冲区的长度(Buffersize),但是strcpy函数还是会复制。当然,副词在句子中往往可以忽略,直接理解为copy也是可以的。
(2)on the end
这里之所以用on, 可能是因为data对buffer而言是on,例如:I have a pimple right on the end of my nose。参考:https://ell.stackexchange.com/questions/111682/on-the-end-of-something
(3)past
这里为什么使用past呢?如果不用,那么on the end of buffer也说得通。这里之所以用past,表示已经超过了缓冲区,past取“prep. to a position that is further than a particular point”之意。
2.obligation什么意思?
答:
(1)oblige:ob-("to") + ligare("to bind"),to bind by oath(以誓言约束)。
(2)oblige > obligation:obligation的意思是“n. the fact that you are obliged to do sth”(义务,责任)
p129,"you have an obligation to check the length of the source string before you copy it using strpy"。
3.equivalent of语法分析
答:p129,“Thus,the Pig Latin equivalent of any is anyway”,初看到这句话的时候心里是困惑的,因为记忆中都是把equivalent当做形容词用,后面接to。这里接of,那么就是用作名词:n. sth that has the same amount,value, purpose etc as sth else。
三、参考资料
1. 编程
(1)Eric S.Roberts,《Programming Abstractions in C》:https://book.douban.com/subject/2003414
2. 英语
(1)Etymology Dictionary:https://www.etymonline.com
(2) Cambridage Dictionary:https://dictionary.cambridge.org
欢迎搜索及关注:编程人(a_codists)
Programming abstractions in C阅读笔记:p127-p129的更多相关文章
- Mongodb Manual阅读笔记:CH3 数据模型(Data Models)
3数据模型(Data Models) Mongodb Manual阅读笔记:CH2 Mongodb CRUD 操作Mongodb Manual阅读笔记:CH3 数据模型(Data Models)Mon ...
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十三章:角色动画
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十三章:角色动画 学习目标 熟悉蒙皮动画的术语: 学习网格层级变换 ...
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试 代码工程地址: https://github.co ...
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第六章:在Direct3D中绘制
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第六章:在Direct3D中绘制 代码工程地址: https://gi ...
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第四章:Direct 3D初始化
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第四章:Direct 3D初始化 学习目标 对Direct 3D编程在 ...
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二章:矩阵代数
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二章:矩阵代数 学习目标: 理解矩阵和与它相关的运算: 理解矩阵的乘 ...
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第一章:向量代数
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第一章:向量代数 学习目标: 学习如何使用几何学和数字描述 Vecto ...
- 阅读笔记 1 火球 UML大战需求分析
伴随着七天国庆的结束,紧张的学习生活也开始了,首先声明,阅读笔记随着我不断地阅读进度会慢慢更新,而不是一次性的写完,所以会重复的编辑.对于我选的这本 <火球 UML大战需求分析>,首先 ...
- [阅读笔记]Software optimization resources
http://www.agner.org/optimize/#manuals 阅读笔记Optimizing software in C++ 7. The efficiency of differe ...
- 《uml大战需求分析》阅读笔记05
<uml大战需求分析>阅读笔记05 这次我主要阅读了这本书的第九十章,通过看这章的知识了解了不少的知识开发某系统的重要前提是:这个系统有谁在用?这些人通过这个系统能做什么事? 一般搞清楚这 ...
随机推荐
- Django4全栈进阶之路1 Django4下载与安装
python 下载安装: 下载网址:https://www.python.org/downloads/ 安装方法:https://www.cnblogs.com/beichengshiqiao/p/1 ...
- WSGI实现一个WEB服务
- Django django-rest-framework-simplejwt
Django(75)django-rest-framework-simplejwt「建议收藏」 发布于2022-09-16 11:56:13阅读 2440 大家好,又见面了,我是你们的朋友全栈君. ...
- [ABC270F] Transportation
[ABC270F] Transportation 题意 有 \(n\) 个点,有 \(m\) 条可以加上的边,如果两个点同时建立了一种东西,那么也算连了一条边,每条边都有个代价,每个点建一个东西也有不 ...
- 提升 Apache Hudi Upsert 性能的三个建议
Apache Hudi 社区一直在快速发展,各公司正在寻找方法来利用其强大的功能来有效地摄取和管理大规模数据集. 每周社区都会收到一些常见问题,最常见的问题与 Hudi 如何执行更新插入有关,以确保以 ...
- this关键字理解
编译器对对象的加载步骤: (1)类名 (2)成员变量 (3)成员方法 即使定义类时,成员变量写在成员方法后面,加载对象时,也是先加载成员变量 当编译器识别方法时,会对成员方法改写,在所有方法里隐藏一个 ...
- postgresql 安装和配置
### 安装过程 \1. 下载Postgresql源码包: \# wget http://ftp.postgresql.org/pub/source/v9.4.3/postgresql-9.4.3.t ...
- 聊聊CSS 缓动函数的新成员linear()
CSS 缓动函数是一种用于控制 CSS 动画过渡效果的函数,可以让动画变得更加自然.这篇文章将介绍一种新的 CSS easing function,即 linear(),它可以模拟出更复杂的缓动效果, ...
- 自定义 coding.net 静态网站域名
点击文章左下角 "阅读原文",预览本文章的示例站点. 在上一篇文章<使用 coding.net 发布你的个人博客>,我们介绍了怎么在 coding.net 部署个人的静 ...
- 野火指南者(STM32F103VET6)应用:实现USB虚拟串口(CDC_VPC)
MCU:STM32F103VET6 开发环境:STM32CubeMX+MDK5 实现USB的虚拟串口不需要去理解USB的底层驱动,只需要STM32CubeMX去配置生成工程即可.在野火的指南者中,是没 ...