摘自维基百科:

In C[4] and C++,[5] sequence points occur in the following places. (In C++, overloaded operators act like functions, and thus operators that have been overloaded introduce sequence points in the same way as function calls.)

  1. Between evaluation of the left and right operands of the && (logical AND), || (logical OR), and comma operators. For example, in the expression *p++ != 0 && *q++ != 0, all side effects of the sub-expression *p++ != 0 are completed before any attempt to access q.
  2. Between the evaluation of the first operand of the ternary "question-mark" operator and the second or third operand. For example, in the expression a = (*p++) ? (*p++) : 0 there is a sequence point after the first *p++, meaning it has already been incremented by the time the second instance is executed.
  3. At the end of a full expression. This category includes expression statements (such as the assignment a=b;), return statements, the controlling expressions of if,switchwhile, or do-while statements, and all three expressions in a for statement.
  4. Before a function is entered in a function call. The order in which the arguments are evaluated is not specified, but this sequence point means that all of their side effects are complete before the function is entered. In the expression f(i++) + g(j++) + h(k++)f is called with a parameter of the original value of i, but iis incremented before entering the body of f. Similarly, j and k are updated before entering g and h respectively. However, it is not specified in which order f(),g()h() are executed, nor in which order ijk are incremented. Variables j and k in the body of f may or may not have been already incremented. Note that a function call f(a,b,c) is not a use of the comma operator and the order of evaluation for ab, and c is unspecified.
  5. At a function return, after the return value is copied into the calling context. (This sequence point is only specified in the C++ standard; it is present only implicitly in C.[6])
  6. At the end of an initializer; for example, after the evaluation of 5 in the declaration int a = 5;.
  7. Between each declarator in each declarator sequence; for example, between the two evaluations of a++ in int x = a++, y = a++[7].

翻译:

在c和c++中,sequence points发生在下列位置。(在c++中重载操作符的行为就像函数,这些操作符的sequence points规则同函数调用)

  1. 逻辑与(&&),逻辑或(||)和逗号(,)的左边和右边的赋值之间。
  2. 在(?:)表达式中,?左边的赋值与右边的任一表达式之间。
  3. 在完整表达式(分号,return表达式,if, switchm while, do-while, for的3个表达式中的每一个)的后面---不能是子表达式。
  4. 在一个函数调用时,进入函数体之前。函数的参数调用顺序并未指定(应该指的是一个表达式中的多个函数调用各自的参数)。这个sequence point的意思是,在每个函数进入之前,它们参数的副作用都已经处理完毕。如: f(i++)+g(j++)+h(k++), 在f()进入之后,i一定已经增加了,但是此时在f()内部,j 和 k可能还没有增加,同时,在整个表达式中f(), g(), h()的调用顺序是不确定的。i++, j++, k++的调用顺序也是不确定的。。
  5. 在一个函数return的时候,回到调用程序中之后(只在c++中有效,在c中是隐含(啥叫隐含)的)。
  6. 初始化语句之后,如 int a = 4; 的后边。
  7. 在声明语句的每一个声明之间。如: int a = 4, b = a++, c = a++;这是正确的。

Sequence point 中文相关推荐

  1. PRBS码是什么?PRBS生成原理介绍(转)

    转自:http://blog.sina.com.cn/s/blog_9fa828d10102y3dp.html 之前一直在讲高速串行的协议,MAC,PHY,PMD层,PMA层吗,PCS层...看大家回 ...

  2. Python性能分析入门——cProfile、可视化、逐行分析、内存分析

    文章目录 简介 cProfile PyCharm 可视化 安装 gprof2dot SnakeViz PyCallGraph 逐行分析 内存分析 内存堆分析 其他 遇到的坑 参考文献 简介 通过性能分 ...

  3. 嵌入式开发专业术语概念汇总

    专业术语概念 SDK 概念:软件开发工具包(SDK,全称:Software Development Kit) SDK是Software Development Kit的缩写,中文意思是"软件 ...

  4. 蓝牙BQB测试基础知识(一)

    蓝牙BQB认证的射频测试原理总结如下: PRBS:Pseudo-Random Binary Sequence,中文翻译叫做伪随机二进制序列. PRBS 码的周期长度与其阶数有关,常用的阶数有 7 . ...

  5. CodeBlocks 中文乱码converting to execution character set illegal sequence

    遇到的问题如标题所示,看了几篇的解决教程,这里分享下我的看法和解决方式: CodeBlocks默认保存的格式是WINDOWS-936字符集,也就是GBK编码.这里不改动其他,直接在settings-& ...

  6. GitHub开源:17M超轻量级中文OCR模型、支持NCNN推理

    目录 1.项目简介 2.项目配置 3.问题解决 1.项目简介 近期GitHub上一位大神开源了一个叫做chineseocr_lite的OCR的项目,这是一个超轻量级中文OCR,支持竖排文字识别.NCN ...

  7. Python、Unicode和中文

    python的中文问题一直是困扰新手的头疼问题,这篇文章将给你详细地讲解一下这方面的知识.当然,几乎可以确定的是,在将来的版本中,python会彻底解决此问题,不用我们这么麻烦了. 先来看看pytho ...

  8. linux下batik-rasterizer.jar生成图片中文乱码

    为什么80%的码农都做不了架构师?>>>    发现原来jdk5.0在linux下和以前的版本还不一样,默认不支持中文字体的.得手动去搞一个fontconfig配置, 此文件在$JA ...

  9. 如何训练2457亿参数量的中文巨量模型“源1.0”

    如何训练2457亿参数量的中文巨量模型"源1.0" 浪潮人工智能研究院 从2018年的BERT到2020年的GPT-3,NLP语言模型经历了爆发式的发展过程,其中BERT模型的参数 ...

最新文章

  1. lombok使用基础教程
  2. sqlserver 去除 重复列 [行]
  3. 对财务客户开具Invoice(无销售流程)
  4. asp.net DataGrid GridView 表格之选中行与获取选中行数据
  5. couchbase_具有Rx-Java的Couchbase Java SDK
  6. LeetCode 244. 最短单词距离 II(哈希map+set二分查找)
  7. Linux 双网卡绑定
  8. shouldoverrideurlloading为什么有时候不走_为什么付出越多,对方就越不懂得感恩,婚姻有时候也需要斤斤计较...
  9. matlab 冒泡排序函数,Matlab排序算法-遍历排序、冒泡排序
  10. 地图刷新 android,android – 如何刷新谷歌地图.
  11. geoserver发布切片影像地图
  12. 联邦学习隐私保护相关知识总结
  13. ERROR Failed to send requests for topics
  14. proteus 0.96OLED IIC仿真 SSD1306 UG-2864HSWEG01
  15. 云计算概论 -- 云使能技术
  16. Web项目部署到TongWeb的注意事项,TongWeb踩过的坑
  17. 三分法与二分法的区别和三分法总结
  18. (转载)80后一代的尴尬
  19. 笔记本内存和台式机内存的区别
  20. android+延迟拍摄,延时摄影很难吗? iphone拍+后期全搞定

热门文章

  1. 2018年12月14日 函数 总结
  2. 目标检测之Faster-RCNN的pytorch代码详解(数据预处理篇)
  3. EBS 抓trace 文件
  4. AR + ROS +UBUNTU16.04+ORB-SLAM2
  5. Facebook的实时Hadoop系统
  6. SQLserver安全设置攻略
  7. Windows客户端C/C++编程规范“建议”——函数
  8. libuvc介绍及简单使用
  9. C++11中std::lock_guard的使用
  10. 在对话框中应用CScrollView显示图像