zoukankan      html  css  js  c++  java
  • i = ++i + i;

    In C99  --- 6.5 Expressions

    Between the previous and next sequence point an object shall have its stored value
    modified at most once by the evaluation of an expression. Furthermore, the prior value
    shall be read only to determine the value to be stored

    2. Between the previous and next sequence point an object shall have its stored valuemodified at most once by the evaluation of an expression. Furthermore, the prior value shall be read only to determine the value to be stored.

    3. The grouping of operators and operands is indicated by the syntax. Except as specified later (for the function-call (), &&, ||, ?:, and comma operators), the order of evaluation of subexpressions and the order in which side effects take place are both unspecified

    In C++ ISO/IEC 14882:2003 --- 5 Expressions

    4. Except where noted, the order of evaluation of operands of individual operators and subexpressions of individual expressions, and the order in which side effects take place, is unspecified.53) Between the previous and next sequence point a scalar object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be accessed only to determine the value to be stored.The requirements of this paragraph shall be met for each allowable ordering of the subexpressions of a full expression; otherwise the behavior is undefined.

     

    So undefined:

    i = v[i++];

    i = ++i + 1;

    while allowing

    i = i + 1;

    a[i] = i;

  • 相关阅读:
    springcloud入门案例
    springcloud搭建eureka服务
    nginx配置反向代理服务器
    Nginx配置http服务器
    Bootstrap响应式布局介绍
    Node.js中间件的使用
    Node.js服务器创建和使用
    Nodejs模块使用
    Nodejs模块介绍
    NodeJS的概述
  • 原文地址:https://www.cnblogs.com/aoaoblogs/p/1748103.html
Copyright © 2011-2022 走看看