当前位置: 首页 > news >正文

深圳网站营销seo电话免费注册网站的平台

深圳网站营销seo电话,免费注册网站的平台,如何用xampp做网站,建设工程 法律 网站《Programming Abstractions In C》学习第52天#xff0c;p130-p131#xff0c;总结如下#xff1a; 一、技术总结 1. pig latin game 通过pig latin game掌握字符复制#xff0c;指针遍历等操作。 /** 输入#xff1a;字符串#xff0c;这里采用书中坐着自定义的get…《Programming Abstractions In C》学习第52天p130-p131总结如下 一、技术总结 1. pig latin game 通过pig latin game掌握字符复制指针遍历等操作。 /** 输入字符串这里采用书中坐着自定义的getline函数*/ #include stdio.h #include string.h #include simpio.h#define MaxWord 1000static _Bool IsVowel(char ch); // 书中p34, if适用于非此即彼的两种选择(two-way);如果有多个那么就使用switch。 static void PigLatin(char *word, char buffer[], int bufferSize);static char *FindFirstVowel(char *word); // *表示函数FindFirstVowel返回一个指向char的指针int main() {char *word;char translationBuffer[MaxWord 1];printf(Enter a word: );word GetLine();PigLatin(word, translationBuffer, MaxWord 1);printf(Pig Latin: %s\n, translationBuffer); }/** Function:IsVowel* Usage: isVowel IsVowel(character)* -----------------------------------* 该函数判断字符是否是元音字母如果是返回True,否则返回False。*/ _Bool IsVowel(char ch) {switch (ch) {case A:case E:case I:case O:case U:case a:case e:case i:case o:case u:return TRUE;default:return FALSE;} }/** Function: PigLatin* Usage: PigLatin(word, buffer, bufferSize);* ------------------------------------------* This function translate a word from English to Pig Latin. The* translated word is written into the array buffer, which has an* allocated size of bufferSize. The code checks for buffer* overflow and generate an error if it occurs.*/static void PigLatin(char *word, char buffer[], int bufferSize) {char *vp;int wordLength;vp FindFirstVowel(word);wordLength strlen(word);if (vp word) {wordLength 3;} else if (vp ! NULL) {wordLength 2;}if (wordLength bufferSize) {Error(Buffer overflow);}if (vp NULL) { // 单词中不存在元音字母不做任何修改strcpy(buffer, word);} else if (vp word) { // 单词以元音字母开头 在单词末尾添加way(示例any anyway)strcpy(buffer, word);strcat(buffer, way);} else {// 单词以辅音字母开头: (1)将辅音字母移动到单词尾部直到第一个字母是元音字母。// (2)移动完成后在单词尾部添加ay(示例trash ashtray)strcpy(buffer, vp);strncat(buffer, word, vp - word);strcat(buffer, ay);} }/** FindFirstVowel: 找出单词中的第一个元音字母*/ static char *FindFirstVowel(char *word) {char *cp; // 将原来的指针赋值给新的指针避免原来的指针被修改// 遍历指针for (cp word; *cp ! \0; cp) { // 注意:在这里*cp表示的是值if (IsVowel(*cp)) {return cp; // 注意:cp移动之后cp指向的地址改变了}}return NULL; // 如果找不到则返回空指针(NULL) }完整代码见https://github.com/codists/Programming-Abstractions-In-C/tree/main/chapter3/piglatingame 二、英语总结 1.check用法分析 答p130“The code checks for buffer overflow and gennerates an error if it occurs.”记忆中check是及物动词这里为何会跟for?check既可以用作及物动词(vi)也可以用作不及物动词(vt)意思是to make certain that sth is corret by examinming it.”。 (1)vt.对xxx进行检查。示例Customs stopped us and checked ( searched) our bags for alcohol and cigarettes(海关拦住了我们检查我们的包里有没有烟酒)。 (2)vi.例如书中的用法。其实也可以改成及物动词的用法The code check string length and buffersize for buffer overflow and gennerates an error if it occurs.代码对字符串的长度和buffer的大小进行检查(即判断字符串的长度与buffersize的大小关系)看是否存在缓冲区溢出的情况如果存在就报错。 2.up to 什么意思 答p129, “If the word begins with the consonant, the function extracts the string of consonant up to the first vowel, moves that collection of consonant to the end of the word”。 “up to”在这里的用法是“prep. until(直到)”这里是两个词式的介词。 3.concern 什么意思 答p131, “Almost half the code in the function, however, is concerned with making sure that the buffer does not overflow.”concern在这里的意思是“vt. about”。 三、参考资料 1. 编程 (1)Eric S.Roberts《Programming Abstractions in C》https://book.douban.com/subject/2003414 2. 英语 (1)Etymology Dictionaryhttps://www.etymonline.com (2) Cambridage Dictionaryhttps://dictionary.cambridge.org 欢迎搜索及关注编程人(a_codists)
http://www.pierceye.com/news/583571/

相关文章:

  • 青岛网站优化排名视频源网站怎么做
  • 做网站找我二级学院网站建设方案
  • 知名网站建设公司 北京近期网络营销的热点事件
  • 网站开发产品经理网站例子
  • 动态静态结合网站网站做404是什么意思
  • 注册域名的网站网站建设的具体步骤
  • 行业网站分类自建站排名
  • 网站备案 登陆安徽省住房和城乡建设厅网站领域
  • 做个网站需要多少钱.网站建设合同注意事项
  • 中国诚信建设网站在线代码生成器
  • 长沙企业网站建设团队目前网络最好的挣钱平台
  • 国家建设工程安全质量监督网站友情链接网
  • 适合html初学者做的网站中卫网站推广软件
  • 一个vps主机放两个网站 速度怎么做发卡网站
  • 海米云网站建设网站开发 去哪里找页面
  • 天津做网站优化的公司新手学做网站优化
  • 万网怎么上传网站wordpress google字体 360
  • 为什么建设的网站有时候访问慢6紫金优化网站制作
  • 如何在公司系统建网站广州短视频seo哪家好
  • 电气网站开发福安网站定制
  • 推荐一下做图文的网站html简单的个人网页代码
  • 网页新建站点网站建设缺陷
  • 移动端网站推广怎么申请pc网站域名
  • 外国男男做暧暧视频网站二级建造师考试试题
  • 普通网站建设是什么wordpress主题显示不
  • 朔州网站建设全球速卖通是什么平台
  • wordpress外贸网站好用的模板下载网站开发就业趋势
  • 长春模板建站代理网站开发嘉比格网络
  • 网站建设预算企业网站的公司和产品信息的介绍与网络营销关系
  • 网站开发的学习电子商务网站建设公