首页 > 其他分享 >Programming abstractions in C阅读笔记:p132-p137

Programming abstractions in C阅读笔记:p132-p137

时间:2023-08-29 09:00:21浏览次数:43  
标签:p137 string p132 abstractions Programming strlib 字符串

《Programming Abstractions In C》学习第53天,p132-p137,3.2小节“strings”总结如下:

一、技术总结

3.2小节介绍了字符串的用法:

1.C语言是没有字符串(string)这种数据类型的,但是实际的场景中又很需要这种数据类型,那怎么表示字符串呢?有两种方法:1.用字符数组表示。2.用字符指针表示。

2.C自带的字符串库是string,作者为了更好的使用string,封装出了strlib库,所以在书中的代码经常会看到作者在头文件中引入strlib这个库,而不是直接引用string库。

3.执行字符串复制的时候要考虑是否会产生buffer overflow问题。

二、英语总结

1.rather什么意思?

答:p132,“Note that this test does not check whether the strings are equal but rather whether the pointer are equal”。 rather在这里的意思是“adv. used to express an opposite opion”,用于表达一种相反的观点,具体的意思根据上下文。例如在这句话里面的意思是“而是”。

2.impose什么意思?

答:in-(*en, "into, in") + pose("put, place"),vt. to introduce sth(引入),暗含“强制”之意。p132,Because the complexity imposed by string.h interface tends to get in the way of understanding more critical algorithmic issues,so...(因为string.h接口带来的复杂性往往会妨碍理解更关键的算法问题,所以......)。

3.present什么意思?

答:vt. to give, provide in a formal way。相对于give或者provide而言,present更正式一些。p132,The interface is called strlib.h and is presented in its complete form in Figure 3-6。

三、参考资料

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)

标签:p137,string,p132,abstractions,Programming,strlib,字符串
From: https://www.cnblogs.com/codists/p/17663819.html

相关文章

  • Programming abstractions in C阅读笔记:p130-p131
    《ProgrammingAbstractionsInC》学习第52天,p130-p131,总结如下:一、技术总结1.piglatingame通过piglatingame掌握字符复制,指针遍历等操作。/**输入:字符串,这里采用书中坐着自定义的getline函数*/#include<stdio.h>#include<string.h>#include"simpio.h"#def......
  • Programming abstractions in C阅读笔记:p127-p129
    《ProgrammingAbstractionsInC》学习第51天,p127-p129,总结如下:一、技术总结1.stringlibrary掌握常用函数如strlen,strcpy用法。2.bufferoverflow(缓冲区溢出)(1)什么是buffer?p129,Arraysthatarepreallocatedandlateruseasarepositoryfordatacalledbuffers......
  • Programming abstractions in C阅读笔记:p123-p126
    《ProgrammingAbstractionsInC》学习第50天,p123-p126,总结如下:一、技术总结1.notaion这也是一个在计算机相关书籍中出现的词,但有时却不是那么好理解,因为它可以指代很多对象,这里做一个记录。示例:p124。InC,youcanuseanycharacterarraytoholdstringdata.charstr[6]={......
  • Programming abstractions in C阅读笔记: p118-p122
    《ProgrammingAbstractionsInC》学习第49天,p118-p122,总结如下:一、技术总结1.随机数(1)seedp119,"Theinitialvalue--thevaluethatisusedtogettheentireprocessstart--iscallaseedfortherandomgenerator."二、数学总结1.均匀分布(uniformdistribution)......
  • Programming abstractions in C阅读笔记: p114-p117
    《ProgrammingAbstractionsinC》学习第48天,p114-p117,​总结如下:一、技术总结主要通过randomnumber介绍了随机数的相关用法,interface​示例(random.h)​,clientprogram示例(craps.c)。#include<stdio.h>#include"genlib.h"#include"random.h"staticboolTryToMakePo......
  • Programming abstractions in C阅读笔记p111-p113: boilerplate
    《ProgrammingAbstractionsInC》学习第47天,p111-p113,总结如下:一、技术总结1.boilerplate/**File:random.h*Version:1.0*LastmodifiedonFriJul2216:44:361994byeroberts*-----------------------------------------------------*Thisinterfacepr......
  • Programming abstractions in C阅读笔记p111-p113: boilerplate
    《ProgrammingAbstractionsInC》学习第47天,p111-p113,总结如下:一、技术总结1.boilerplate/**File:random.h*Version:1.0*LastmodifiedonFriJul2216:44:361994byeroberts*-----------------------------------------------------*Thisinterfaceprovi......
  • 删数问题 洛谷p1323
    决定做一系列贪心,贪心真的,最早学的算法,到现在还有时候不太敢贪,还贪不来,一直挺逃避贪心问题的。。 删除前的数字可以先用优先队列对所有数字进行预处理,数据范围是3e4,也不是很大,直接全部处理了吧。constintN=1e5+10,inf=0x3f3f3f3f3f3f3f3f,MAX=3e4+10;inta[N]......
  • Programming abstractions in C阅读笔记:p107-p110
    《ProgrammingAbstractionsInC》学习第46天,p107-p110,3.1小节——“Theconceptofinterface”,总结如下:一、技术总结1.clientp108,调用library的program称为client。2.interfacep108,"Todoso,thechapterfocusesontheboundarybetweenalibraryanditsclients,wh......
  • Programming abstractions in C阅读笔记:p107-p110
    《ProgrammingAbstractionsInC》学习第46天,p107-p110,3.1小节——“Theconceptofinterface”,总结如下:一、技术总结1.  clientp108,调用library的program称为client。2.  interfacep108,"To do so, the chapter focuses on the boundary between a library and ......