《Programming Abstractions In C》学习第50天,p123-p126,总结如下:

一、技术总结

1.notaion

这也是一个在计算机相关书籍中出现的词,但有时却不是那么好理解,因为它可以指代很多对象,这里做一个记录。示例:p124。

In C, you can use any character array to hold string data.

char str[6] = {'h', ' ', 'l', ' ', 'o', '\0'};

or, more compactly,

char str[6] = "hello";

If you use array notation, the standar idion for processing every character in a string looks like this:

for (int i = 0; str[i] != '\0'; i++) {

  printf("i=%d\n", str1[i]);

}

在这里,“notation”以理解为“the activity of representing sth by a special system of marks or character”,即“notation”表示的是一种“标记方法”、“表示方法”。

2.字符串用法示例

#include <stdio.h>

// 统计字符串中的空格(space):数组版
static int CountSpaces(char str[]) {
int i, nSpaces; nSpaces = 0;
for (i = 0; str[i] != '\0'; i++) {
if (str[i] == ' ') {
nSpaces++;
}
}
return nSpaces;
} // 统计字符串中的空格(space):指针版
static int CountSpaces1(char *str) {
int nSpaces;
char *cp; nSpaces = 0;
for (cp = str; *cp != '\0'; cp++) {
if (*cp == ' ') {
nSpaces++;
}
}
return nSpaces; } int main() {
// 方式一:declare and initialize a string "hello"
char str1[6] = {'h', ' ', 'l', ' ', 'o', '\0'};
// 遍历字符串
for (int i = 0; str1[i] != '\0'; i++) {
printf("i=%d\n", str1[i]);
} // 方式二:更紧凑(compactly)
char str2[6] = "hello"; // 统计字符串中的空格
int n;
n = CountSpaces(str1);
printf("\nthe number of spaces in string is: %d\n", n); // 2 // 统计字符串中的空格
int n1;
n1 = CountSpaces1(str1);
printf("\nthe number of spaces in string is: %d\n", n1); // 2 }

二、英语总结

1.perfectively什么意思?

答:perfect是“完美的”之意,但是perfectly翻译的时候直接翻译成"完美地"却不大合适。应该翻译成"adv. perfectly can alse mean very or compeletly"(很,非常)更好,当然,其实这个意思也是“in a perfect way”。

2.likelihood什么意思?

答:u.the chance than sth will happen(可能性),同义词:possibility。

三、参考资料

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阅读笔记:p123-p126的更多相关文章

  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-09-28:合并区间。以数组 intervals 表示若干个区间的集合,其中单个区间为 intervals[i] = [starti, endi] 。请你合并所有重叠的区间,并返回一个不重叠

    2021-09-28:合并区间.以数组 intervals 表示若干个区间的集合,其中单个区间为 intervals[i] = [starti, endi] .请你合并所有重叠的区间,并返回一个不重叠 ...

  2. pycharm eslint should be on a new line

    修改前: "vue/max-attributes-per-line": [2, { "singleline": 10, "multiline" ...

  3. ET介绍—— 一切皆实体的设计

    一切皆实体 目前十分流行ECS设计,主要是守望先锋的成功,引爆了这种技术.守望先锋采用了状态帧这种网络技术,客户端会进行预测,预测不准需要进行回滚,由于组件式的设计,回滚可以只回滚某些组件即可.ECS ...

  4. react eject提示This git repository has untracked files or uncommitted changes:

    在yarn eject 但时 老是提示This git repository has untracked files or uncommitted changes: Remove untracked ...

  5. vue数组更改页面无法刷新

    今一个图片列表的数组,在新增数据时页面会同步相应,但是进行删除操作时老是无法实现页面及时刷新,使用过vue set也没见效果,纠结半天,哎原来是嵌套对象的坑 一.图片上传时 页面加的图片列表的html ...

  6. fofa搜索技巧

    转载自:https://www.cnblogs.com/sunny11/p/14388508.html ` 目录 题记 技巧(我一般找国内的,所以下边一直加cn) 1.搜索HTTP响应头中含有&quo ...

  7. tryhackme_nmap

    https://www.cnblogs.com/-Lucky-/p/17100073.html Nmap基本端口扫描 nmap中考虑的端口状态 Open:表示服务正在侦听指定端口. Closed:表示 ...

  8. 揭秘 Task.Wait

    目录 简介 背后的实现 Task.Wait 的两个阶段 SpinWait 阶段 BlockingWait 阶段 Task.Wait 可能会导致的问题 可能会导致线程池饥饿 可能会导致死锁 .NET 6 ...

  9. A First course in FEM —— matlab代码实现求解传热问题(稳态)

    这篇文章会将FEM全流程走一遍,包括网格.矩阵组装.求解.后处理.内容是大三时的大作业,今天拿出来回顾下. 1. 问题简介 涡轮机叶片需要冷却以提高涡轮的性能和涡轮叶片的寿命.我们现在考虑一个如上图所 ...

  10. Spring 中的 Bean

    前言 欢迎来到本篇文章,鸽了好久了,今天继续写下 Spring 的内容:Spring 中 Bean 的基本概念.基本写法和 3 种实例化 Bean 的方式等. 什么是 Bean? 我们回顾下,什么是 ...