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

广州做网站厉害的公司网站制作公司官网

广州做网站厉害的公司,网站制作公司官网,北京做网站比较有名的公司,合肥网站建设方案策划《Programming Abstractions In C》学习第55天,p139-p140,总结如下: 一、技术总结 1.文件I/O操作 文件I/O操作可以分为一下这些步骤: (1)声明文件指针对象。 File *infile;(2)打开文件 fopen()。打开文件的模式有“r”, “w…

《Programming Abstractions In C》学习第55天,p139-p140,总结如下:

一、技术总结

1.文件I/O操作

文件I/O操作可以分为一下这些步骤:

(1)声明文件指针对象。

File *infile;

(2)打开文件

fopen()。打开文件的模式有“r”, “w”, "a"三种模式。

(3)传输数据

读取文件的方式可以是character by character( getc()/putc() ),也可以是line by line( fget()/fput() )。

(4)关闭文件

fclose()。

2.文件I/O操作示例:复制文件

#include <stdio.h>
#include <stdbool.h> // for bool, true, false data type
#include <stdlib.h> // for exit()void CopyRemovingComments(FILE *infile, FILE *outfile);int main() {// 声明文件指针对象FILE *infile, *outfile;char *infileName, *outfileName;/** 打开文件:fopen()* 如果文件不存在,则返回NULL,所以需要检查*/infileName = "D:\\CProject\\chater3.4\\jabber.txt"; // 这里使用的是绝对路径,也可以使用相对路径outfileName = "D:\\CProject\\chater3.4\\jabbercopy.txt";infile = fopen(infileName, "r");if (infile == NULL) {printf("Cannot open input file: %s \n", infileName);exit(0);}/** 传输数据* 传输数据有很多种方式,例如chracter by character(getc/putc),line by line(fget/fput, ReadLine)* 为了解决stdio.h存在的一些问题,作者对stdio进行了封装,封装后得到的的是simpio*/outfile = fopen(outfileName, "w");if (outfile == NULL) {printf("Cannot open output file: %s \n", outfileName);exit(0);}CopyRemovingComments(infile, outfile);/** 关闭文件*/fclose(infile);fclose(outfile);printf("Copying is completed");return 0;
}void CopyRemovingComments(FILE *infile, FILE *outfile) {int ch, nch;bool commentFlag; // 这里使用的是stdbool.h接口中的boolcommentFlag = false; // 这里使用的是stdbool.h接口中的false,书中使用的是封装后的FALSEwhile ((ch = getc(infile)) != EOF) {if (commentFlag) {if (ch == '*') {nch = getc(infile); //if (nch == '/') {commentFlag = false;} else {ungetc(nch, infile);}}} else {if (ch == '/') {nch = getc(infile);if (nch == '*') {commentFlag = true;} else {ungetc(nch, infile);}}if (!commentFlag) {putc(ch, outfile);}}}
}

二、英语总结

1.endpoint什么意思?

答:c.the end of sth(终点)。

2.transfer什么意思?

答:transfer也是一个在计算机相关资料中经常看到的词。p140, For an input file, the function read data from the file into your program; for an output file, the function transfer data from the program to the file。数据从文件到程序中,或者从程序中到文件,即是一种transfer。通过该例句,对tranfer有一个形象的了解。

3.intermix什么意思?

答:

(1)解释:vi/vt. to combine two or more different things。

(2)搭配:intermix sth with sth。

(3)例句:p140, Doing so allows you to intermix numeric data with strings and other data types。

三、参考资料

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)

http://www.hkea.cn/news/263398/

相关文章:

  • 深圳网站如何制作西安seo网站推广优化
  • 网站建设业务文案网站seo检测工具
  • 石家庄做外贸网站建设现在最好的营销方式
  • 兰州做网站公司有哪些html+css网页制作成品
  • 福州做网站的公司多少钱信息流优化
  • 群晖的网站开发百度客服怎么转人工
  • 制作网站项目流程无锡网站建设seo
  • 最好的开发网站建设价格如何搜索网页关键词
  • 做网站犯法了 程序员有责任吗网站建设合同
  • 建设部职称网站关键词优化营销
  • 做seo还要需要做网站吗百度热搜榜排行
  • 福建城市建设厅网站怎么推广一个网站
  • 机构网站建设需要交费吗关键词挖掘
  • 专业网站建设费用报价今日最新消息
  • 电商网站建设论文2022黄页全国各行业
  • 能源企业 网站建设网络营销的应用
  • 如何看网站是用什么语言做的关键词排名是由什么决定的
  • 政府网站建设招标书百度网站收录
  • 已经有了网站怎么做推广哈尔滨关键词优化报价
  • 网站建设与管理作业镇江推广公司
  • 域名申请好后 如何建设网站网站权重划分
  • 佛山百度网站快速优化网络营销推广工具
  • 建一个网站需要哪些人广州seo网站推广公司
  • 建设银行etc官方网站搜索引擎优化的七个步骤
  • 做网站需要花钱吗海南百度推广运营中心
  • 做的网站显示图片很慢百度运营公司
  • 青州哪里做网站公司推广渠道
  • 网站面包屑导航怎么做的网推接单平台有哪些
  • 宜昌网站建设兼职百度关键词排名软件
  • 如何让百度快照找到自己的网站营销策划方案ppt模板