C Programming: difference between ++i and i=i+1 from an assembler point of view?

后端 未结 6 512
予麋鹿
予麋鹿 2021-02-05 11:53

This was an interview question. I said they were the same, but this was adjudged an incorrect response. From the assembler point of view, is there any imaginable difference? I h

6条回答
  •  情深已故
    2021-02-05 12:39

    In C++, it depends if i is an int or an object. If it's an object, it would probably generate a temporary instance.

提交回复
热议问题