您的位置 首页 > 德语词汇

boilerplate是什么意思,boilerplate的意思翻译、用法、同(C阅读笔记p111)

大家好,今天来为大家解答boilerplate是什么意思,boilerplate的意思翻译、用法、同这个问题的一些问题点,包括C阅读笔记p111也一样很多人还不知道,因此呢,今天就来为大家分析分析,现在让我们一起来看看吧!如果解决了您的问题,还望您关注下本站哦,谢谢~

boilerplate是什么意思,boilerplate的意思翻译、用法、同(C阅读笔记p111)

《ProgrammingAbstractionsInC》学习第47天,p111-p113,总结如下:

/*\n*File:random.h\n*Version:1.0\n*LastmodifiedonFriJul2216:44:361994byeroberts\n*-----------------------------------------------------\n*Thisinterfaceprovidesseveralfunctionsforgenerating\n*pseudo-randomnumbers.\n*/\n\n#ifndef_random_h\n#define_random_h\n\n#include"genlib.h"\n#include<stdlib.h>\n\n/*\n*Constant:RAND_MAX\n*------------------\n*Unfortunately,severallibrariesthatsupposedlyconformto\n*theANSIstandarddonotdefineRAND_MAXin<stdlib.h>.To\n*reduceportabilityproblems,thisinterfacedefinesRAND_MAX\n*tobethelargestpositiveintegerifitisundefined.\n*/\n\n#ifndefRAND_MAX\n#defineRAND_MAX((int)((unsigned)~0>>1))\n#endif\n\n/*\n*Function:Randomize\n*Usage:Randomize();\n*-------------------\n*Thisfunctionsetstherandomseedsothattherandomsequence\n*isunpredictable.Duringthedebuggingphase,itisbestnot\n*tocallthisfunction,sothatprogrambehaviorisrepeatable.\n*/\n\nvoidRandomize(void);\n\n/*\n*Function:RandomInteger\n*Usage:n=RandomInteger(low,high);\n*------------------------------------\n*Thisfunctionreturnsarandomintegerintherangelowtohigh,\n*inclusive.\n*/\n\nintRandomInteger(intlow,inthigh);\n\n/*\n*Function:RandomReal\n*Usage:d=RandomReal(low,high);\n*---------------------------------\n*Thisfunctionreturnsarandomrealnumberinthehalf-open\n*interval[low..high),meaningthattheresultisalways\n*greaterthanorequaltolowbutstrictlylessthanhigh.\n*/\n\ndoubleRandomReal(doublelow,doublehigh);\n\n/*\n*Function:RandomChance\n*Usage:if(RandomChance(p))...\n*---------------------------------\n*TheRandomChancefunctionreturnsTRUEwiththeprobability\n*indicatedbyp,whichshouldbeafloating-pointnumberbetween\n*0(meaningnever)and1(meaningalways).Forexample,calling\n*RandomChance(.30)returnsTRUE30percentofthetime.\n*/\n\nboolRandomChance(doublep);\n\n#endif\n

p113,Thesethreelinesareoftenreferredtoasinterfaceboilerplate。boilerplate这个词会在计算机相关的教材中会经常看到,英文的意思是:“textthatcanbecopiedandusedincomputerprogram,withonlysmallchanges.”(模板),之所以叫模板,是因为在每个头文件中都有这三句。这个单词不难理解,关键是通过此次的教材对这个单词有一个具体的、形象的记录,当提到这个单词,就知道具体指的是什么。

答:die:n.asmallcubewithadifferentnumberofspotsoneachside.(骰子),所以rolladie的就是"掷骰子"。

答:alongwith在表示伴随、以及或连同等意思时,两者之间无先后顺序,可能在前也可能在后。这点与follow不同。示例:Foreachofthesefunctions,theinterfacecontains

one-lineprototypealongwithacommentthatdescribethepurposeofthefunctionfrom

#ifndef_random_h

causethecompilertoskipanytextuptothe#endiflineifthethesymbol_random_hhasbeenpreviouslydefined。

(1)adv.usedtosaythatsthislessthanorequaltobutnotmorethanastatedvalue。

都表示的是“程度”,而不是“方向”。

1)EricS.Roberts,《ProgrammingAbstractionsinC》:https://book.douban.com/subject/2003414

1)EtymologyDictionary:https://www.etymonline.com

2)CambridageDictionary:https://dictionary.cambridge.org

欢迎搜索及关注:编程人(a_codists)

OK,关于boilerplate是什么意思,boilerplate的意思翻译、用法、同和C阅读笔记p111的内容到此结束了,希望对大家有所帮助。

本站涵盖的内容、图片、视频等数据,部分未能与原作者取得联系。若涉及版权问题,请及时通知我们并提供相关证明材料,我们将及时予以删除!谢谢大家的理解与支持!

Copyright © 2023