求教 C语言编译过程 (++i)+(++i)+(++i)有关问题

求教 C语言编译过程 (++i)+(++i)+(++i)问题
#include <stdio.h>
void main(){
int i=5,j=5,p,q;
p=(i++)+(i++)+(i++);
q=(++j)+(++j)+(++j);
printf("%d,%d,%d,%d",p,q,i,j);

}
输出结果:15,22,8,8Press any key to continue 为什么呢? 求高手!!!!

------解决方案--------------------
探讨

The result depends on what kind of compiler you are using!

------解决方案--------------------
取决于编译器...
------解决方案--------------------
探讨
引用:

The result depends on what kind of compiler you are using!

计算结果取决于不同的编译器

------解决方案--------------------
探讨

不同的编译器会出现不同的结果,因此写程序应该尽量避免这样的语句

------解决方案--------------------
由于C++标准没有规定++执行顺序不定,这就导致在一行代码中若出现多次++时,可能出现在不同的编译器中编译执行时出现不同的结果
------解决方案--------------------
对于这种问题,最好的做法就是反汇编分析,但是实际上弄清楚这个问题的意义不大,
实际开发中是禁止写出这种代码的。有可能依赖编译器结果不同。
.text:00401000 ; int __cdecl main(int argc, const char **argv, const char **envp)
.text:00401000 _main proc near ; CODE XREF: ___tmainCRTStartup+15Ap
.text:00401000
.text:00401000 var_10 = dword ptr -10h
.text:00401000 var_C = dword ptr -0Ch
.text:00401000 var_8 = dword ptr -8
.text:00401000 var_4 = dword ptr -4
.text:00401000 argc = dword ptr 8
.text:00401000 argv = dword ptr 0Ch
.text:00401000 envp = dword ptr 10h
.text:00401000
.text:00401000 push ebp
.text:00401001 mov ebp, esp
.text:00401003 sub esp, 10h
.text:00401006 mov [ebp+var_8], 5
.text:0040100D mov [ebp+var_10], 5
.text:00401014 mov eax, [ebp+var_8]
.text:00401017 add eax, [ebp+var_8]
.text:0040101A add eax, [ebp+var_8]
.text:0040101D mov [ebp+var_4], eax
.text:00401020 mov ecx, [ebp+var_8]
.text:00401023 add ecx, 1
.text:00401026 mov [ebp+var_8], ecx
.text:00401029 mov edx, [ebp+var_8]
.text:0040102C add edx, 1
.text:0040102F mov [ebp+var_8], edx
.text:00401032 mov eax, [ebp+var_8]
.text:00401035 add eax, 1
.text:00401038 mov [ebp+var_8], eax
.text:0040103B mov ecx, [ebp+var_10]
.text:0040103E add ecx, 1
.text:00401041 mov [ebp+var_10], ecx
.text:00401044 mov edx, [ebp+var_10]
.text:00401047 add edx, 1
.text:0040104A mov [ebp+var_10], edx
.text:0040104D mov eax, [ebp+var_10]
.text:00401050 add eax, 1
.text:00401053 mov [ebp+var_10], eax
.text:00401056 mov ecx, [ebp+var_10]
.text:00401059 add ecx, [ebp+var_10]
.text:0040105C add ecx, [ebp+var_10]
.text:0040105F mov [ebp+var_C], ecx
.text:00401062 mov edx, [ebp+var_10]
.text:00401065 push edx
.text:00401066 mov eax, [ebp+var_8]
.text:00401069 push eax
.text:0040106A mov ecx, [ebp+var_C]