C/C++ Math Order of Operation

后端 未结 5 1480
一生所求
一生所求 2020-12-11 19:10

So I know that C++ has an Operator Precedence and that

int x = ++i + i++;

is undefined because pre++ and post++ are at the same level and t

5条回答
  •  情歌与酒
    2020-12-11 19:32

    It might be saying that it is undefined because you have chosen an int, which is the set of whole numbers. Try a double or float which include fractions.

提交回复
热议问题