首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 171 毫秒
1.
本文讨论了C语言的前缀++(前缀--)与后缀++(后缀--)运算符的优先级、C程序设计和调试的几点技巧,更好地让学生进一步学好C语言,掌握C语言程序设计,提高学生的软件开发能力。  相似文献   

2.
C语言教学探讨——易造成学生困惑的几种运算符   总被引:1,自引:0,他引:1  
阳晓霞  刘清华 《福建电脑》2007,(11):214-214,212
C语言提供了非常丰富的运算符,这些看似简单的运算符之间,有着特殊的规则.本文就学习C语言运算时,容易造成学生困惑的几种运算符,采用详尽的C语言实例论证,使学生能够较好地理解C语言运算.  相似文献   

3.
C语言教学过程中普遍存在一个对C语言中自加运算符的错误认识,根据C99规范对该错误进行详细分析,指出后缀加运算符与前缀加运算符的本质区别,解释C语言中令人颇难理解的一个特性。  相似文献   

4.
C语言对数据有很强的表达能力,具有十分丰富的运算符,利用这些运算符可以组成各种表达式及语句。运算符就是完成某种特定运算的符号。表达式则是由运算符及运算对象所组成的具有特定含义的一个式子。由运算符或表达式可以组成C语言程序的各种语句。C语言是一种表达式语言,在任意一个表达式的后面加一个分号";"就构成了一个表达式语句。按照运算符在表达式中所起的作用,可分为算术运算符、关系运算符、逻辑运算符、赋值运算符、增量与减量运算符、逗号运算符、条件运算符、位运算符、指针和地址运算符、强制类型转换运算符和sizeof运算符等。运算符按其在表达式中与运算对象的关系,又可分为单目运算符、双目运算符和三目运算符等。单目运算符只需要有一个运算对象,双目运算符要求有两个运算对象,三目运算符要求有三个运算对象。  相似文献   

5.
各种高级程序设计语言的运算符均有“=“这一基本的运算符,但C语言的“=“运算符在功能特点上和其它语言有很大的区别.本文详细介绍了C语言赋值运算“=“的性质,并对常见的问题进行了归纳分析.  相似文献   

6.
各种高级程序设计语言的运算符均有“=”这一基本的运算符,但C语言的“=”运算符在功能特点上和其它语言有很大的区别。本文详细介绍了C语言赋值运算“=”的性质,并对常见的问题进行了归纳分析。  相似文献   

7.
<正>(接上期)九、C语言的运算符C语言提供了30多个运算符,范围很大,应用广。除了控制语句和输入、输出之外,几乎所有的基本操作,都是按照运算符来进行处理的,可见  相似文献   

8.
C语言区别于其他高级语言特点之一就是运算符的结合性.该文通过几个典型实例剖析了C语言运算符结合性的具体应用及分析方法.  相似文献   

9.
熊风光  况立群  韩焱 《计算机工程与设计》2012,33(10):3858-3861,3958
针对目前逻辑表达式求值算法中运算符的名称、优先级和运算规则都以硬编码的形式固化在算法中所带来的算法无法扩展的问题,通过将运算符的名称、优先级和运算规则抽象为接口的方法,设计并实现了一种新的逻辑表达式求值系统。该系统既保证了表达式求值算法的独立性,又允许用户自定义运算符和更新原有运算符运算规则,从而实现了逻辑表达式求值的可扩展性。  相似文献   

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

11.
非计算机专业C程序设计教学方法创新   总被引:4,自引:3,他引:1  
C语言中数据类型和运算符丰富,概念复杂,规则繁多,针对学习者的特点和认识规律,如何设计教学方法、强调重点、分散难点、深入浅出地教好C语言课程,已成为任课教师教学研究的首要任务,本文设计出一套适合高校非计算机专业学生的C程序设计课程整体教学方法,经采用取得了良好的教学效果,提高了教学质量。  相似文献   

12.
董卫红 《微型电脑应用》2012,28(1):49-50,54,69
C语言的运算符,操作灵活,其中自增自减运算符的功能较为特别。合理的使用自增自减运算符可以提高程序执行的效率,但同时灵活使用自增自减运算符也是个难点。根据自增自减运算符的特点和不同使用形式,剖析自增自减运算符的使用规则,以便更好地帮助初学者学习和使用自增自减运算符。  相似文献   

13.
A wide range of parser generators are used to generate parsers for programming languages. The grammar formalisms that come with parser generators provide different approaches for defining operator precedence. Some generators (e.g. YACC) support precedence declarations, others require the grammar to be unambiguous, thus encoding the precedence rules. Even if the grammar formalism provides precedence rules, a particular grammar might not use it. The result is grammar variants implementing the same language. For the C language, the GNU Compiler uses YACC with precedence rules, the C-Transformers uses SDF without priorities, while the SDF library does use priorities. For PHP, Zend uses YACC with precedence rules, whereas PHP-front uses SDF with priority and associativity declarations.The variance between grammars raises the question if the precedence rules of one grammar are compatible with those of another. This is usually not obvious, since some languages have complex precedence rules. Also, for some parser generators the semantics of precedence rules is defined operationally, which makes it hard to reason about their effect on the defined language. We present a method and tool for comparing the precedence rules of different grammars and parser generators. Although it is undecidable whether two grammars define the same language, this tool provides support for comparing and recovering precedence rules, which is especially useful for reliable migration of a grammar from one grammar formalism to another. We evaluate our method by the application to non-trivial mainstream programming languages, such as PHP and C.  相似文献   

14.
I. C. Pyle 《Software》1980,10(4):307-318
Some programming languages allow the programmer to define operators. Algol-68 allows user-defined operator symbols with user-defined priorities and user-defined bodies; nevertheless the language rules insist on left-to-right evaluation of equal precedence operators. The new Department of Defense DoD language Ada allows the programmer to define new operators, but restricts them to language-defined operator symbols with language-defined priorities: in other words, only user-defined bodies. The language rules concerning operators are therefore stronger, and imply properties of operators: ‘axioms’, which should apply even for use-rdefined bodies. The paper discusses sensible constraints which should be accepted for user-defined operators
  • 1 An earlier version of this paper was presented at the IFIPWG2.4 (System Implementation Languages) meeting at Twente, June 1978. The author thanks members of WG2.4 for their comments.
  • .  相似文献   

    15.
    C语言是基础的编程语言。C语言的程序编写和运算规则很丰富,尤其是C语言的算法简便、易读,实现快捷,使得C语言成为程序员的入门学习语言和练习的首选。介绍了C语言的优势,对几种常见的算法采用渐进式的解读,分别分析了算法的思路。  相似文献   

    16.
    李文军  周晓聪  李师贤 《软件学报》2001,12(10):1555-1561
    优先关系是并发系统控制的重要手段,常用于解决并发系统设计中的冲突问题.在有界P/T系统的基础上提出一种动态优先系统,并分别给出它们的交错语义与真并发语义.动态优先系统既可以作为并发与分布式系统的建模工具,也可以作为定义程序设计语言中优先算子的语义基础.最后,基于动态优先系统的概念,为Occam语言扩充了一种动态优先选择算子.  相似文献   

    17.
    C语言程序设计是高效计算机专业学生必修的一门基础课程,同时也是后续课程的入门课程,对于掌握基本计算机技术有着重要意义。尤其在Linux系统下,该系统在所有操作系统中占着重要地位,如何掌握计算机C语言编程技巧是当务之急。为此,本文重点探讨基于Linux系统分析计算机C语言编程技巧。  相似文献   

    18.
    This paper presents a practical method of adding problem-specific notation to an established computer language. Our idea is to use unrestricted operator overloading as a tool to map the problem domain notation directly into an existing programming language. Our method introduces new operator symbols and function names into a host language by overloading existing usage. We extend the host programming language syntax to an augmented language which is mapped to the host language by a programmable preprocessor. The preprocessor uses a programmer-modifiable symbolic language grammar to translate an augmented program into a standard program. This process gives a natural extension to any computer language without modifying the host language. Direct use of problem notation can improve program legibility and code comprehension within the problem domain. The preprocessor provides a useful research tool for exploring language issues without the need to write a compiler for a new language. It can also be used to provide a domain specific language for a programming group at lower cost than new language development. This paper presents several working examples which illustrate our work. We redefine many of the standard C operators to alleviate some of the more common programming errors, thus creating a ‘cleaner’ C. As a more esoteric example, we encode a subset of APL vector operators as an algebraic extension to the C language. A curious application of our method shows its success in an arbitrary problem domain by compiling and executing poetry. Our final example introduces standard symbolic logic notation into C for tautology verification. © 1998 John Wiley & Sons, Ltd.  相似文献   

    19.
    Previous attempts to apply Halstead's software metrics to APL have led to inconsistent and counter-intuitive results. This work is a further investigation into the application of software metrics to APL to try to resolve some of the inconsistency. The effect of variations in the counting rules on values calculated for the software metrics was studied. These rules were used to analyze a set of programs from a previous study. In addition, a large number of APL programs from a university environment were analyzed. Evidence is presented that verifies that APL has a higher language level than any other common programming language previously studied. Counting monadic and dyadic uses of the same APL symbol as an instance of a different operator was found to have a significant effect on the language level calculated for APL. However, decomposing derived APL functions into separate operators did not seem to have a significant effect on language level.  相似文献   

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

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

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

    京公网安备 11010802026262号