Unit2(ProgrammingLanguage)分析.pptVIP

  1. 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Unit2(ProgrammingLanguage)分析

Unit Two Programming Language Text A Functions in C Almost all programming languages have some equivalent of the function. You may have met them under the alternative names subroutine or procedure. Some languages distinguish between functions which return variables and those which dont 有些语言区分函数根据是否有返回值 C assumes that every function will return a value.If the programmer wants a return value, this is achieved using the return statement C假设每个函数将返回一个值.如果程序员希望返回值,这是通过使用返回语句实现的 If no return value is required, none should be used when calling the function.Here is a function which raises a double to the power of an unsigned, and returns the result. 如果不需要返回值,调用函数时不需要使用.这是一个定义了无符号的双精度型乘幂函数 The function follows a simple algorithm, multiplying the value by itself pow times. 该函数有如下一个简单的算法,乘以自身的幂次的值。 A for loop is used to control the number of multiplications, and variable ret_val stores the value to be returned for循环是用来控制数乘法次数的,而且ret_val变量的值保存返回值。 Careful programming has ensured that the boundary condition is correct too. Let us examine the details of this function 严谨的程序确保了边界条件是正确的.让我们来看看这个函数的详细信息 double power(double val, unsigned pow).This line begins the function definition. It tells us the type of the return value, the name of the function, and a list of arguments used by the function. 这行开始了函数的定义,它告诉我们,返回值的类型,函数的名称,以及由该函数使用的参数列表 The arguments and their types are enclosed in brackets, each pair separated by commas 参数和它们的类型包含在括号,用逗号分隔 The body of the function is bounded by a set of curly brackets. Any variables declared here will be treated as local unless specifically declared as static or extern types 函数体以一对花括号为界.声明的任何变量都将被认为是本身所有的除非是静态型或外部类型 return(ret_val);On reaching a return statement, control of the program returns to the calling function 一个返回语句,控制程序返回给调用函数 The bracketed value is the value which is returned from the function 括号内的值是由函数返回的值。 If the final closing curly bracket is reached before any return value, then the function will return automatically, any retu

文档评论(0)

1520520 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档