首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 515 毫秒
1.
C语言应用中,自增自减运算符运用灵活、广泛且具有一定的使用技巧和难度,在编程过程中,往往是初学者最难理解和最容易出错的运算符。本文根据自增自减运算符的特点和两种使用形式,剖析自增自减运算符的功能和在不同编译环境下的运算规则,以便更好地为初学者学习和使用提供帮助。  相似文献   

2.
李小兰  罗芳 《数字社区&智能家居》2007,1(2):1011-1011,1025
C语言中自增、自减运算符使用灵活。本文对自增、自减运算符在赋值语句和printf0函数中运算规则的使用做了一些有益的探讨.以方便读者对此运算符有一个全面的理解和正确的使用。  相似文献   

3.
王红 《电脑学习》1999,(4):27-28
运算符多,操作灵活是C文3的一大特色。在诸多运算符中,最难理解,最容易出错的便是自增,自减运算符。本文就这两个运算符使用中应注意的问题进行了分析介绍。  相似文献   

4.
自增自减运算符在C语言的编程过程中经常用到,具有重要的作用,而灵活使用自增自减运算符则是个难点。该文从几个例子入手,观察运行的结果,对结果进行分析,最后得出结论。以期能使初学者避重就轻,从而熟练掌握自增自减运算符。  相似文献   

5.
C语言中的自增(减)运算符是一种非常实用的运算符,它可以十分方便地让一个变量实现自身的值加(减)一个1,这样可以大大缩减编程代码的长度.但是,这种运算符的执行情况非常复杂,稍不注意就会产生不可估计的错误,对于初学C语言的人来说,使用自增(减)运算符应该慎重.  相似文献   

6.
C语言的内部运算符很丰富,运算符是告诉我们编译程序执行特定算术或逻辑操作的符号。其中,最难理解的是在使用过程中最易得到模棱两可的结果自增自减运算符,对这两个运算符的使用做了详细说明。  相似文献   

7.
自增运算符是C语言的比较灵活的、方便的运算符,某种程度上使程序设计简单,但是同时带来了一些问题,该文结合实例进行了分析,方便读者更加全面的了解和使用自增运算符。  相似文献   

8.
运算符多、操作灵活是C语言的一大特色.在诸多运算符中,最容易出错的便是自增、自减运算符.C语言允许在一个表达式中使用两个以上的赋值类运算,包括赋值运算符、自增自减运算符等.这种灵活性使程序简洁,但同时也会带来副作用.这种副作用主要表现在:使程序费解,并易于发生误解或错误.例如,当i=3时,表达式(i++)+(i++)+(i++)的值为多少,各种教材说法不一.有的认为是9(即为3+3+3);也有的认为是12(即为3+4+5).到底哪个正确呢?我们不妨来看看下面这个程序的运行情况:main()  相似文献   

9.
自加、自减运算符是具有副作用的运算符,在实际应用中,单个自加、自减运算符容易理解,但多个自加、自减运算符同时出现在表达式中时,就不容易理解了,而且很容易出错,所以在应用中对一个表达式中的多个自加、自减运算符要特别小心谨慎。  相似文献   

10.
冯治广 《电脑编程技巧与维护》2011,(18):147+150-147,150
自加、自减运算是C语言中的一个语法难点部分,对于初学者来说一直都是个难题,甚至很多编程高手也会产生困惑。通过实例分析总结了自加、自减运算符的运算规则过程,解析困惑,简洁明了。  相似文献   

11.
局部变量的存储赋值研究   总被引:1,自引:0,他引:1  
DSP芯片通常提供了特定的内存地址生成单元(AGU)和包含地址运算的自增量/自减量的间接寻址模式.通过合理地安排变量在堆栈上的存储位置,尽可能多地使用自增量/自减量寻址方式来来访问局部变量,从而减少地址运算指令的数量,提高程序性能.本文详细地讨论了实现局部变量最优布局的算法,并且给出该算法在gcc上的实现.  相似文献   

12.

A Markov chain on a new evolutionary computing algorithm is analyzed in continuous state space. By establishing transition probability density, the convergence of the similartaxis operator is proved. Meanwhile, the local property of the similartaxis operator is shown. To avoid its prematurity, a dissimilation operator need to be introduced. With the concept of P-absorbing field and P-optimal state, the convergence of the dissimilation operator is proved. We apply this new algorithm to a difficult problem for the accurate mixture ratio of raw materials of cement processing and make a comparison between GAs and the new algorithm. Finally, the functions of similartaxis and dissimilation operators are analyzed in a practical view.  相似文献   

13.
首先分析了柔性多面体搜索算法和基本遗传算法两者结合的基础,提出了柔性多面体方向进化算子和柔性多面体交叉算子,以这两个新的遗传操作算子和柔性多面体搜索算法为基础,提出了两种新的混合遗传算法FP-HGA(Ⅰ)、FP-HGA(Ⅱ).在FP-HGA(Ⅰ)中,嵌入了柔性多面体方向进化算子和柔性多面体搜索算法;在FP-HGA(Ⅱ)中,嵌入了柔性多面体交叉算子,用FP-HGA(Ⅰ)、FP-HGA(Ⅱ)及SGA(Simple Genetic Algorithm)来求解Rosenbrock测试函数的最小值,FP-HGA(Ⅰ)和FPHGA(Ⅱ)算法和SGA算法的计算结果表明该混合遗传算法在收敛速度和精度方面均得到很大提高.  相似文献   

14.
15.
David H. Hartley 《Software》1992,22(2):101-110
Random access to local variables stored in a stack frame is more difficult for compiled functions when the target processor lacks register-plus-offset addressing. One alternative technique employs a roving pointer which the program increments or decrements as needed between stack accesses. Processors which support auto-increment and auto-decrement addressing modes are often capable of performing these increments for free when consecutive accesses are to adjacent stack locations. For these processors, the compiler's chosen ordering for the local variables in the stack frame can substantially affect the execution speed of the compiled program. This paper is concerned with finding an ordering for the local variables in the frame that maximizes the likelihood that two consecutive references at run-time will be to the same or to adjacent stack locations. We have formulated a solution to this problem in terms of finding a Hamiltonian path in a graph. Although this problem is NP-complete in general, we have developed a heuristic algorithm that delivers good results with acceptable performance.  相似文献   

16.
The changes in the spectrum caused by structured perturbations of pseudo-resolvents and operators on Banach spaces are considered. In particular, if a point is in the resolvent set of an operator, necessary and sufficient conditions for it to remain in the resolvent set under structured perturbations are given. The structured perturbations of an operator are specified by an operator node that has three generating operators and a characteristic function together with an admissible feedback operator. In addition, the robustness of stability under structured perturbations is analyzed. The results are applied to boundary control systems and impedance passive systems.  相似文献   

17.
常用模糊控制算法中各类算子对系统输出的影响   总被引:6,自引:6,他引:0  
韩卫华 《微计算机信息》2006,22(11):260-261
模糊控制系统的核心是模糊控制算法,由于其合取算子、蕴涵算子、汇总算子和去模糊化算子选取的不同,使其算法区别很大。文中对几种常用模糊控制算法的输出曲面进行比较,以确定这些算子变化对系统输出的影响。  相似文献   

18.
This work investigates the operator mapping problem for in-network stream-processing. In a stream-processing application, a tree of operators is applied, in steady-state mode, to datasets that are continuously updated at different locations in the network. The goal is to generate updated final results at a desired rate. In in-network stream-processing, dataset updates and operator computations are performed by servers distributed in a network. We consider the problem of mapping operators to these servers in the case of multiple concurrent stream-processing applications. In this case, different operator trees corresponding to different applications may share common subtrees, so that intermediate results can be reused by different applications. This work provides complexity results for different versions of the operator mapping problem, which can be formulated as integer linear programs. Several polynomial-time heuristics are proposed for a particularly relevant version of the problem, which is NP-hard. These heuristics are compared and evaluated via simulation. The results demonstrate the importance of mapping the operators to appropriate processors, and the importance of sharing common sub-trees across operator trees.  相似文献   

19.
提出了采用实数编码情况下应用进化方向算子的几种策略,包括单亲进化方向算子、双亲进化方向算子以及无轮盘赌选择的双亲进化方向算子策略,并进行了数值仿真。仿真结果表明,灵活使用方向进化算子以及遗传操作可大大提高遗传算法的全局搜索能力。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号