本文介绍了什么是序列点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我知道一个序列点的基本定义(所有一侧 效果保证完成的点),但我对这个 语句感到困惑: "在上一个和下一个序列点之间,一个对象应该通过表达式的评估最多修改一次它的 存储值。 此外,只能访问先前的值以确定要存储的 值。 有人能给我一些表达式的例子吗"勉强"打破这个 规则(一个新人可能会绊倒的类型)? 如果你在序列点之间,那第二句是什么 表示先前值?I know the basic definition of a sequence point (point where all sideeffects guaranteed to be finished), but I am confused about thisstatement:"Between the previous and next sequence point an object shall have itsstored value modified at most once by the evaluation of an expression.Furthermore, the prior value shall be accessed only to determine thevalue to be stored."Can someone give me examples of expressions that "barely" break thisrule (the type a newcomer might trip over)?If you are between sequence points, then what does that second sentencemean "prior value"?推荐答案 具体来说, http://www.eskimo.com/~scs/C-faq/q3.8.html 也相关: http:// www。 eskimo.com/~scs/C-faq/q3.1.html http://www.eskimo.com/~scs/C-faq/q3.2.html http://www.eskimo.com/~scs/C-faq/q3 .3.html http://www.eskimo.com/~scs/C-faq/q3.9.html 然后,阅读整个常见问题解答。 然后再读一遍。 :-) - 兰迪霍华德(2个删除FOOBAR) 经常做蠢事这也很难实现聪明的工作。 。 - Andrew KoenigSpecifically, http://www.eskimo.com/~scs/C-faq/q3.8.htmlAlso related: http://www.eskimo.com/~scs/C-faq/q3.1.html http://www.eskimo.com/~scs/C-faq/q3.2.html http://www.eskimo.com/~scs/C-faq/q3.3.html http://www.eskimo.com/~scs/C-faq/q3.9.htmlThen, read the entire FAQ.Then read all of it again. :-)--Randy Howard (2reply remove FOOBAR)"Making it hard to do stupid things often makes it hardto do smart ones too." -- Andrew Koenig 具体来说, http://www.eskimo.com/~scs/C-faq/q3 .8.html 还相关: http://www.eskimo.com/~scs/C-faq/q3.1.html http://www.eskimo.com/~scs/C-faq/q3。 2.html http://www.eskimo.com/~scs/C-faq/q3.3.html http://www.eskimo.com/~scs/C-faq/q3。 9.html 然后,阅读整个FAQ。 然后再读一遍。 : - ) Specifically, http://www.eskimo.com/~scs/C-faq/q3.8.html Also related: http://www.eskimo.com/~scs/C-faq/q3.1.html http://www.eskimo.com/~scs/C-faq/q3.2.html http://www.eskimo.com/~scs/C-faq/q3.3.html http://www.eskimo.com/~scs/C-faq/q3.9.html Then, read the entire FAQ. Then read all of it again. :-) 我在原帖之前阅读了常见问题解答。实际上这是常见问题,我想知道我是否一直都很幸运 当我在表情中使用副作用时。 来自FAQ的这句话让我很困惑: "第二句话很难理解。它说如果一个 对象被写入一个完整的表达式,那么在同一个表达式中对它进行的任何和所有访问都必须用于计算 要写的值。这条规则有效地将法律表达限制在那些访问明显在修改之前的人。 对FAQ的解释更加困惑来自 标准的句子比标准本身。我一直困惑于一边 效果和序列点:_(I read the FAQ before my original post. It was the FAQ that actuallytickled my mind and made me wonder if I was just lucky all this timewhen I was using side effects in expressions.This sentence from the FAQ really confused me:"The second sentence can be difficult to understand. It says that if anobject is written to within a full expression, any and all accesses toit within the same expression must be for the purposes of computing thevalue to be written. This rule effectively constrains legal expressionsto those in which the accesses demonstrably precede the modification."More confused about the FAQ''s explanation of the sentence from thestandard than the standard itself. I''m all around confused about sideeffect and sequence points :_( 具体来说, http://www.eskimo.com/~ scs / C-faq / q3.8.html 还相关: http://www.eskimo.com/~scs/C-faq/q3.1.html http://www.eskimo.com/~scs /C-faq/q3.2.html http://www.eskimo.com/~scs/C-faq /q3.3.html http://www.eskimo.com/~scs/C-faq/q3.9.html 然后,请阅读整个常见问题解答。 Specifically, http://www.eskimo.com/~scs/C-faq/q3.8.html Also related: http://www.eskimo.com/~scs/C-faq/q3.1.html http://www.eskimo.com/~scs/C-faq/q3.2.html http://www.eskimo.com/~scs/C-faq/q3.3.html http://www.eskimo.com/~scs/C-faq/q3.9.html Then, read the entire FAQ. Then read all of it again. :-) 我在原帖之前阅读了常见问题解答。这是常见问题,实际上让我感到震惊,让我想知道我是否一直都是幸运的当我在表情中使用副作用时。 I read the FAQ before my original post. It was the FAQ that actually tickled my mind and made me wonder if I was just lucky all this time when I was using side effects in expressions. 好​​吧,第一个之后的链接包含特定的例子。我希望希望他们中的一个或多个能打开你的灯泡,因为我通常会发现这些例子对法律术语来说很有用 变得势不可挡。 特别是3.2有一个更长的解释,一个常见的例子 。它似乎对我很好地解释了,所以如果那不是为你做的话,也许其他人可以提供更好的解释。 - 兰迪霍华德(2个人正在删除FOOBAR) 让难做蠢事常常让人很难 做聪明也是。 - Andrew KoenigOk, well, the links after the first one contain specific examples. Iwas hoping that one or more of them would turn the lightbulb on foryou because I usually find that examples can be helpful when the legalesegets overwhelming.In particular, 3.2 has a more lengthy explanation, and a common exampleas well. It seems to explain it pretty well to me, so if that doesn''t doit for you, maybe somebody else can provide a better explanation.--Randy Howard (2reply remove FOOBAR)"Making it hard to do stupid things often makes it hardto do smart ones too." -- Andrew Koenig 这篇关于什么是序列点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-31 02:40