c语言规范标准中英文,C语言中英文翻译资料.doc

253b171540df25e1b84436cbe50dfc72.gifC语言中英文翻译资料.doc

The C Programming LanguageC is a high-level programming language developed by Dennis Ritchie and Brian Kernighan at Bell Labs in the mid-1970s. Although originally designed as a systems programming language, C has proved to be a powerful and flexible language that can be used for a variety of applications, from business programs to engineering. C is a particularly popular language for personal computer programmers because it is relatively small-it requires less memory than other languages.The first major program written in C was the UNIX operating system; and for many years, C was considered to be inextricably linked with UNIX. Now, however, C is am important language independent of UNIX. Although it is a high-level languages, C is much closer to assembly language than are most other high-level languages. This closeness to the underlying machine language allows C programmers to write very efficient code. The how-level nature of C, however, can make the language difficult to use for some types of applications.Now lets take an overview of the C programming language, both historically and technically and technically.As a general-purpose programming language, C has been closely associated with UNIX system where it was developed, since both the system and most of the applications that run on it are written in C. The language , however, is not tied to any one operating system or machine; and although it has been called a “system programming language” because it is useful for writing compilers and operating systems, it has been used equally well to write major programs in various fields.Many of the important ideas stem from the language BCPL, developed by Martin Richards. The influence of BCPL on C proceeded indirectly through the language B, which was written by Ken Tompson in 1970 for the first UNIX system on the DEC-PDP-7.BCPL and B are “typeless” languages. By contrast, C provides a variety of data types. The fundamental types are characters, and integers and floating point numbers of several sizes. Additionally, there is a hierarchy of derived data types created with pointers, arrays, structures, and unions. Expressions are ed from operands; any expression, including an assignment or a function call, can be a statement. Pointers provide for machine-independent address arithmetic. C provides the fundamental control-flow constructions required for well-structured programs statement grouping, decision making if-else , selecting one of a set of possible cases switch, looping with the termination test at the top while, for or at the bottom do, and early loop exit break.Functions may return values of basic type, structures, unions, or pointers. Any function may be called recursively. Local variables are typically “automatic”, or created anew with each invocation. Function definitions may not be nested but variables may be declared in a block-structured fashion. The functions of a C program may exist in separate source files that are compiled individually. Variables may be internal to a function, external but known only within a single source files, or visible to the entire program.A preprocessing step pers macro substitution on program text, inclusion of other source file, and conditional compilation. C is a relatively low-level language, meaning that C deals with the same sort of objects that most computers do, namely characters, numbers, and addresses. These may be combined and moved about with the arithmetic and logical operators implemented by real machines.C provides no operations to deal directly with composeite objects such as character strings, sets, lists, or arrays. There are no operations that manipulate an entire any storage allocation facility other than static definition and the stack discipline provided by the local variables of functions; there are no heap or garbage collection . Finally, C itself provides no /output facilities; there are no Read or Write statements, and no built-in file access s. All of these higher-level mechanisms must be provided by explicitly-called functions. Most C implementations have included a reasonably standard collection of such functions.Similarly, C offers only straightforward, single-thread control flow tests, loops, grouping, and subprograms, but not multiprogramming, parallel operations, synchronization, or co-routines.Although the absence of some of these features may seem like a grave deficiency, keeping the language down to modest size has real benefits. Since C is relatively small, it can be described in a small space, and learned quickly. A programmer can reasonably expect to know and understand and indeed regularly use the entire language.In 1983, the American National Standard Institute ANSI established a committee to provide a modern, comprehensive definition of C. The resulting definition, the ANSI standard, or “ANSI C”, was completed late in 1988. Most of the features of the standard are already supported by modern compilers . The standard is based on the original C reference manual. The language is relatively little changed; one of the goals of the standard was to make sure that most existing programs would remain valid, or, failing that, that compilers could produce warning of new behavior.For most programmers, the most important change is a new syntax for declaring and defining functions. A function declaration can now include a description of the arguments of the function; the definition syntax changes to match. This extra ination makes it much easier for compiler to detect errors caused by mismatched arguments. This has proved to be a very useful addition to the language.A second significant contribution of the standard is the definition of a library to accompany C. It specifies functions for accessing the operating system for example, to read and write file, atted and output, memory allocation, string manipulation, and the like. A collection of standard headers provides uni access to declarations of functions and data types. Programs that use this library is closely modeled on the “standard I/O library” of the UNIX system.Although C matches the capability of many computers, it is independent of any particular machine architecture. With a little care it is easy to write portable programs, that is, programs that can be run without change on a variety of hardware.C, however, like any other language, has its blemishes. Some of the operators have the wrong precedence; some parts of the syntax could be better. Nonetheless, C has proved to be an extremely effective and expressive language for a wide variety of programming applications.Having reviewed the history and features of C, lets now study an example C program for a basic understanding of what a C program looks like. The following program finds the factorial of the number 6./* Program to find factorial of 6 */ include stdio.h define3 VALUE 6 int i, j ;main j1;for i1; iVALUE; i jj*I;printf “The factorial of d is dn”, VALUE, j ;As shown in the example, C code starts with include stdio.h , which instructs the compiler to include the standard I/O library into your program so that you can read and write values, handle text files, and so on. C has a large number of standard libraries like stdio, including string, time and math libraries.The define line creates a constant. Two global variables are declared using the int i, j; line, which announces the properties in this case, integer of the two variables. Other common variable types are floatfor real number and char for characters, both of which you can declare in the same way as int.The line main declares the main function. Every C program must have a function named main somewhere in the code, which marks the beginning of your program. In C, the statements of a function are enclosed in braces. In the example the mainfunction contains only three statement, which are an assignment statement, a for statement, and a printf statement.The printf statement in C is easier to use. The portion in double quotes is called the at string and describes how the data is to be atted when printed. The at string contains string literals or string constant such as The factorial of, n also called escape sequence. /n stands for carriage returns, and operators in the of d, which are used as placeholders for variables. The two operatorsalso called conversion specifications in the at string indicate that integer values found later in the parameter list are to be placed into the string at these points. Other operators include f for floating point values, c for characters, and s for strings.In the printf statement, it is extremely important that the number of operators in the at string corresponds exactly with the number and type of the variables following it. For example, if the at string contains three operators and it must be followed by exactly three parameters, and they must have the same types in the same order as those specified by the operators.This program is good, but it would be better if it reads in the value instead of using a constant. Edit the file, remove the VALUE constant, and declare a variable value instead as a global integerchanging all references to lower-case because value is now a variable. Then place the following two lines at the beginning of the programPrintf “Enter the value ”;Scanf“d”, Make the changes, then compile and run the program to make sure it works. Note that scanf uses the same sort of at string as printf. The main j1;for I1;IVALUE;I jj*I;printf“The factorial of d is d n”,VALUE,j;如例中所示,C语言程序(代码)以“includestdio.h”一句开始,其目的只是编译程序将C标准函数库蕴含到用户程序中,以便于读写数据、处理文本文件等等。C语言带有大量像“stdio.h”这样的标准函数库,包括字符串处理、时间及数学运算等函数库。“define”一行定义了一个常量。“int i,j”一行说明了两个全局变量,定义了两个变量的属性(本例中为整数)。其他常用的变量类型还有浮点型(指实数型)、字符型(指字符)等,其说明格式同整型类似。“main”一行说明了本程序的主函数。每一个C语言程序都必须有一个名为“main”的函数,可出现于程序的任意位置,用以标记程序的开始。在C语言中函数的语句都被括在一对中。在本例中,主函数包括三行语句,分别是赋值语句、for循环语句,及printf格式输出语句。C语言中的“printf”语句很容易使用。双引号中的部分叫作格式串,用于描述数据在输出时的格式。格式串可以包括字符常量,如“The factorial of”及“n”(又称作转义序列,n表示回车);还可以包括形如“d”的操作符,用作待输出变量的定位符。本例中格式串的两个操作符(又叫作转换说明),表示出现于后续参数表中的整型数值将被置于该格式字符串的指定位置。类似的格式操作符还有表示浮点数值的“f”、表示字符的“c”,及表示字符串的“s”等。必须注意,在“printf”语句中,格式串中操作符的数目与后续的变量在类型及数目上要严格对应。例如,如果格式串包含三个操作符,在后面的参数也必须有三个,并且参数在类型及出现的顺序上要与前面的操作符一致。这个程序还可以,不过,如果能将常量改为由程序读入数值,则会更好一些。编辑该程序,删除VALUE常量,并说明一个全局变量“value”(把所有变更引用都改为小写,因为“value”现已说明为一个变量),然后将以下两行加到程序的开始处printf“Enter the value”;scanf“d”,修改程序,进行编译并运行,以确保程序无误。值得注意的是,“printf”使用的格式串与“scanf”相同,“value”变量前的“”字符在C语言中称作地址操作符,用于返回指定变量的内存地址。出现于“scanf”中的字符型、整型、浮点型,以及记录型(即结构型)的任何变量都必须加上“”操作符。倘若漏掉“”,运行程序时就会出现错误。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/564409.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

SQL语言深入

数据库系统 数据库系统主要有以下 3 个组成部分: 1 . 数据库:用于存储数据的地方。 2 . 数据库管理系统:用于管理数据库的软件。 3 . 数据库应用程序:为了提高数据库系统的处理能力所使用的管理数据库库的软件补充。 数据库管…

加法的横式竖式教案c语言,20以内竖式加减法教案

【www.ahanw.cn--活动致辞】活动意图:数学的加减法运算很重要。特别是20以内的加减法是各种数字运算的基础。学好20以内的加减法,有利于活化孩子的头脑,发展孩子的思维。活动目标:1、感知进位加、退位减的算法,整理和归…

c语言平面向量加法考点,平面向量的加减法怎么死活都不会?有没有什么口诀?例如:向量AB+BC=?向量OA-OB=?向量AB-CB=?有没有什么口诀!...

设a(x,y),b(x,y).1、向量的加法向量的加法满足平行四边形法则和三角形法则.ABBCAC.ab(xx,yy).a00aa.向量加法的运算律:交换律:abba;结合律:(ab)ca(bc).2、向量的减法如果a、b是互为相反的向量,那么a-b,b-a,ab0.0的反向量为0AB-ACC…

neo4j browser执行脚本后不提示用时_还不懂什么是分层自动化测试的,有赞的实践经历告诉你...

来源:https://testerhome.com/articles/19109# 背景先理一下自动化测试的概念,从广义上来说,一切通过工具(程序)的方式来代替或者辅助手工测试的行为都可以成为自动化。从狭义上来说,通过编写脚本的方式,模拟手工测试…

android+自定义alertdialog,安卓自定义AlertDialog

AlertDialog.png使用方法 example:DialogUtil.showAlertDialog(getActivity(), R.mipmap.restart, "退出提示", "你确定要退出吗?"),"确定", "取消", true, new DialogUtil.AlertDialogBtnClickListener() {Overridepublic…

mysql datetime 后面带了很多0_面试官:MySQL 表设计要注意什么?

作者 孤独烟来自公众号:孤独烟引言大家应该知道烟哥最近要(tiao 咳咳咳),嗯,不可描述!随手讲其中一部分知识,都是一些烟哥自己平时工作的总结以及经验。大家看完,其实能避开很多坑。而且很多问题&#xff0…

android studio viewo,Android Studio 之 ViewModel

ViewModel 是 JetPack 类库中的一个功能,可以保存控件的状态 ,在整个Activity 生命周期中,状态不会失效如屏幕翻转时,状态可保留,不会失效!与 LiveData 配合使用!配合 Room 进行 Sqlite 操作数据…

极域电子书包课堂管理系统_朝阳群众说小康 | 从黑板课本到VR互动课堂、电子书包,朝阳的课堂如此有趣!...

教育变迁一支粉笔、一块黑板、一本教材曾经是教师上课沿袭了几十年的“三大法宝”随着时代发展当科技遇上了教育课堂上又会擦出什么样的火花呢?今天,小朝带你走进咱朝阳的校园一探究竟不一young的朝阳教育近日,教育部“基于教学改革、融合信息…

安装引导黑屏_给电脑安装系统老是装不上,重启就黑屏,原来是这项设置在作怪!...

很多人和我反映说:给电脑安装系统重启电脑后就黑屏无法正确解压系统,这个问题大家有没有遇到呢?遇到这个问题的人可能会认为自己电脑的硬盘坏了,明明已经把需要的Windows操作系统拷贝到硬盘已经成功了,重启电脑准备解压…

如果表不存在则创建_当创建一个文件的时候,操作系统发生了什么

操作文件是我们平时经常有的操作。但是我们可能并不是很了解他们原理,比如为什么删除一个很大的文件,会非常快?创建一个文件的时候,系统发生了什么?为什么删除的文件,还可以恢复?知其然知其所以…

两个html页面之间通讯,面试官:前端跨页面通信,你知道哪些方法?

引言在浏览器中,我们可以同时打开多个Tab页,每个Tab页可以粗略理解为一个“独立”的运行环境,即使是全局对象也不会在多个Tab间共享。然而有些时候,我们希望能在这些“独立”的Tab页面之间同步页面的数据、信息或状态。正如下面这…

默认选中_双击dwg图纸,怎么设置默认天正打开?

文尾左下角阅读原文看视频教程好课推荐:零基础CAD:点我CAD室内:点我 周站长CAD:点我CAD机械:点我 Bim教程:点我CAD建筑:点我CAD三维:点我全屋定制:点我 ps教程&#xff1…

临颖一高2021高考成绩查询,临颍一高举办2021年决战高考百日冲刺誓师大会

原标题:临颍一高举办2021年决战高考百日冲刺誓师大会3月4日,县一高举办2021年决战高考百日冲刺誓师大会,擂响了百日冲刺的战鼓,全校5800余名师生参加誓师大会。誓师大会在激昂雄壮的国歌声中拉开了序幕。县一高校长巩海生满怀深情…

2021年慈溪中学高考成绩查询,2021年慈溪市高考状元名单资料,今年慈溪市高考状元多少分...

高考状元一直都备受大家的关注,不管对于学校和还是当地教育系统,都是一件荣誉的事情。高考状元历来都诞生于艳羡的目光中,大家为他们的高分叫好,羡慕他们可以一步踏入国内知名学府。本文高考升学网为大家介绍历年慈溪市高考状元的…

网际风全推数据接口_智能风控系统设计与实践

导读在主流互联网产品中,比如搜索和推荐的系统,为了挖掘用户潜在购买需求,缩短用户到商品或信息的距离,提高用户的使用体验,都需要使用大量的特征来刻画用户的行为。在信息安全领域,建立在人工智能技术之上…

esp8266 html文件,ESP8266 基ESP8266_RTOS_SDK (ESP-IDF )中嵌入网页文件(示例代码)

场景:在写ESP8266 web服务的时候,免不了要将自己设计的网页html和css等文件放入到固件中。在arduino中有fs可以进行上传文件,然后通过文件系统读出。那在ESP-IDF中该怎么办呢。有几个思路1. 通过flash_download_tools 直接向固定地址写入文件…

高中计算机教师考试专业知识,高中教师资格证计算机专业考试内容

【导读】高中教师资格证计算机专业考综合素质、教育知识与能力和学科知识与教学能力,学科知识与教学能力是考计算机科学与技术的专业知识。高中教师资格证计算机专业考试内容高中教师资格证计算机专业考综合素质、教育知识与能力和学科知识与教学能力,学…

MySQL整数类型

整数类型又称数值型数据,数值型数据类型主要用来存储数字。 MySQL 提供了多种数值型数据类型,不同的数据类型提供不同的取值范围,可以存储的值范围越大,所需的存储空间也会越大。 MySQL 主要提供的整数类型有 TINYINT、SMALLINT…

LISP 冻结excel窗格_粗暴讲解,2分钟 | 即懂excel 冻结首行、首列和单元格怎么弄?...

多少人上手excel,都是基本功不扎实啊?!想起当初自己学做数据,迫于不可抗力因素,糊里糊涂上岗。没囤过基础知识,全靠业务实践练操作。领导甩来什么需求,当天就要查各种方法给他做出来&#xff0c…

MySQL小数类型

MySQL 中使用浮点数和定点数来表示小数。 浮点类型有两种,分别是单精度浮点数(FLOAT)和双精度浮点数(DOUBLE);定点类型只有一种,就是 DECIMAL。 浮点类型和定点类型都可以用(M, D)来表示&…