《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的更多相关文章

  1. Mongodb Manual阅读笔记:CH3 数据模型(Data Models)

    3数据模型(Data Models) Mongodb Manual阅读笔记:CH2 Mongodb CRUD 操作Mongodb Manual阅读笔记:CH3 数据模型(Data Models)Mon ...

  2. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十三章:角色动画

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十三章:角色动画 学习目标 熟悉蒙皮动画的术语: 学习网格层级变换 ...

  3. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试 代码工程地址: https://github.co ...

  4. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第六章:在Direct3D中绘制

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第六章:在Direct3D中绘制 代码工程地址: https://gi ...

  5. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第四章:Direct 3D初始化

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第四章:Direct 3D初始化 学习目标 对Direct 3D编程在 ...

  6. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二章:矩阵代数

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二章:矩阵代数 学习目标: 理解矩阵和与它相关的运算: 理解矩阵的乘 ...

  7. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第一章:向量代数

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第一章:向量代数 学习目标: 学习如何使用几何学和数字描述 Vecto ...

  8. 阅读笔记 1 火球 UML大战需求分析

    伴随着七天国庆的结束,紧张的学习生活也开始了,首先声明,阅读笔记随着我不断地阅读进度会慢慢更新,而不是一次性的写完,所以会重复的编辑.对于我选的这本   <火球 UML大战需求分析>,首先 ...

  9. [阅读笔记]Software optimization resources

    http://www.agner.org/optimize/#manuals 阅读笔记Optimizing software in C++   7. The efficiency of differe ...

  10. 《uml大战需求分析》阅读笔记05

    <uml大战需求分析>阅读笔记05 这次我主要阅读了这本书的第九十章,通过看这章的知识了解了不少的知识开发某系统的重要前提是:这个系统有谁在用?这些人通过这个系统能做什么事? 一般搞清楚这 ...

随机推荐

  1. 2021-10-30:有效的字母异位词。给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。注意:若 s 和 t 中每个字符出现的次数都相同,则称 s 和 t 互为字母异位

    2021-10-30:有效的字母异位词.给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词.注意:若 s 和 t 中每个字符出现的次数都相同,则称 s 和 t 互为字母异位 ...

  2. Requested setting INSTALLED_APPS, but settings are not configured. You must either define the env...

    解决办法 在test.py文件的最头部加上以下代码,配置环境 import os,django os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djb ...

  3. hadoop 2.7.7 ERROR datanode.DataNode: BlockSender.sendChunks() exception: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。

    最近在测试Hbase在windows上的单机版的功能. 版本:hadoop 2.7.7  hbase 2.0.0 错误: ERROR datanode.DataNode: BlockSender.se ...

  4. How to use the shell command to get the version of Linux Distributions All In One

    How to use the shell command to get the version of Linux Distributions All In One 如何使用 shell 命令获取 Li ...

  5. 值得推荐的Blazor UI组件库

    前言 本文主要是推荐一些开源.免费.实用.美观的Blazor UI组件库,提供给广大C#/.NET开发者们学习和使用(注意:排名不分先后,都是十分优秀的开源框架和项目).本文中的所有框架都已经收录到适 ...

  6. [ESP] 私有版Rainmaker User Mapping

    [ESP] 私有版Rainmaker User Mapping 1. 设备烧录的程序esp-rainmaker/examples/gpio这个demo 我这里是自己的工程,可以参照 idf.py se ...

  7. EnhancingDecisionTreeswithGeographicInformationSystemsa

    目录 引言 在计算机科学领域,地理信息系统和( geographical information systems, GIS)已经成为了一个非常受欢迎的工具.GIS 可以用来处理和存储大量的地理数据,支 ...

  8. OOP4-6题目集总结

    4-6次题目集,从集合框架,正则表达式,类的继承与多态三个方面展开,在帮助我们了解java常用的工具(集合框架,正则表达式)的同时让我们学着利用类与类之间的关系来减少耦合,第六次题目集侧重于类的继承与 ...

  9. Linux系统运维之FastDFS集群部署

    一.简介 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件访问(文件上传.文件下载)等,解决了大容量存储和负载均衡的问题.FastDFS服务端有两个 ...

  10. ASP.Net Core 项目部署

    安装环境 部署环境有两种: .Net Core SDK 包含所有运行时和程序开发包,用于程序开发使用,体积相对较大. .Net Core Runtime 仅用于程序运行,不包含开发包,体积小. 注:部 ...