青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

EverSpring working shop

To pursue creative ideas based on nature.

統計

留言簿(1)

他山之石

閱讀排行榜

評論排行榜

The Remark of Usage for ++ and --

Frankly, I am still very confused with the rule for the usage of the ++ and -- in the expression.
Just try some execise in the g++, it seems that the rule for ++/-- is:

As post-increment (X++) or post-decrement (X--), it alaways takes effect after the whole expression is done, even after the assignment is completed;
As pre-increment (X++) or pre-decrement (X--), the ++/ -- firstly takes effect at the place where it is, and then the expression is executed.

For example:
A)
?? int incr = 3;
?? incr = (incr++)*4 + (incr++)*3 + 4;

After the execution, the incr is 27.
Steps:
1. incr = 3*4 + 3*3 + 4 = 25;
2. incr = incr + 2 = 27.

B)
??? incr = 3;
??? incr = (incr--)*4 + (incr--)*3 + 4;

Result incr is 23;

C)
??? incr = 3;
??? incr = (--incr)*4 + (--incr)*3 +? (++incr) * 4;
Result is 19.
Steps:
1. incr = (3-1)*4 + (2-1)*3 + (1+1)* 4 = 19

D)
?? incr = 3
?? incr = (--incr)*4 + (--incr)*3 +? (++incr) * 4 + (incr++);
Result is 22
Steps:
1. incr = (3-1)*4 + (2-1)*3 + (1+1)*4 + 2 = 21
2. incr ++ -> incr = 22.


REMARK Here!

posted on 2009-02-21 20:00 everspring79 閱讀(342) 評論(1)  編輯 收藏 引用 所屬分類: Notes

評論

# re: The Remark of Usage for ++ and -- 2009-02-21 21:20 everspring79

Another Remark - The evil resides in the combination of below operations:

1) ++/--
2) Macro
3) Function Parms
4) Condition Operation.

Example:
A)
int foo(a, b, c)
{
return (a+b+c);
}

void main()
{
int aa = 5, bb = 4, cc = 3, result;

result = foo(aa++, --bb, cc); // result = (5+3+3), aa = 6 now, bb = 3
result = foo(aa++, ++aa, cc); // result = (7+7+3), aa = 8 now
}

B)
#define MIN(a,b) (((a)<=(b))?(a):(b))

int a = 10, b = 7
d = MIN(++a, b);
//May work well according to gcc.
// d = 7, a still = 10
d = (((a++)<=(b))?(a++):(b)) //as the condition is false, the second a++ will not execut.
// d = 7, a = 11
a = 7;
b = 10;
d = (((a++)<=(b))?(a++):(b)) //as the condition is true, the second a++ is executed, a= 9, but d = 7
d = (((a++)<=(b))?(++a):(b)) // as the condtiion is true, the 2nd ++a is executed, this leads to d to be 9, finally a = 9.
//above is an evil. the first a++ will lead a to be 7+1 before ?.
a = 9; b=10
d= (((a++)<=(b))?(a++):(b)) // antoher evil, the d = 10 because the d is assigned by a = 10 before the 2nd a++. After this a = a+1. so the result is d = 10, a =11.

  回復  更多評論   

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产精品久久久久久久久久免费 | 亚洲精品一区二区三区婷婷月 | 夜色激情一区二区| 欧美一区免费视频| 亚洲美女在线视频| 欧美成人免费在线观看| 在线播放日韩| 久久综合色综合88| 欧美一区久久| 国产一区二区三区四区老人| 亚洲欧美激情视频| 一区二区三区视频在线看| 欧美刺激午夜性久久久久久久| 伊人婷婷欧美激情| 免费成人性网站| 亚洲精品色图| 欧美日韩免费一区二区三区视频| 亚洲国产高清自拍| 欧美激情一区二区三区不卡| 久久久久网址| 在线看无码的免费网站| 久久久久久久久久久一区| 午夜久久99| 国产精品入口夜色视频大尺度| 亚洲久久一区二区| 99re6热在线精品视频播放速度| 欧美日韩精品二区第二页| 亚洲在线视频免费观看| 欧美一区二区三区啪啪| 亚洲黄页一区| 亚洲视频在线看| 国内久久婷婷综合| 亚洲美女在线看| 狠狠色综合播放一区二区| 亚洲欧洲视频| 国产午夜精品理论片a级大结局 | 亚洲特色特黄| 久久狠狠久久综合桃花| 亚洲最新视频在线| 久久久精品久久久久| 亚洲小说区图片区| 理论片一区二区在线| 久久av资源网| 欧美三级午夜理伦三级中文幕 | 亚洲欧美精品在线观看| 久久久久成人网| 亚洲男人第一av网站| 暖暖成人免费视频| 久久亚洲精品网站| 国产精品嫩草99av在线| 亚洲精品系列| 亚洲人在线视频| 久久精品二区三区| 欧美中文字幕精品| 国产精品h在线观看| 亚洲黄色在线视频| 亚洲国产婷婷| 久久这里只精品最新地址| 欧美在线影院| 国产欧美日韩亚州综合| 亚洲天堂男人| 亚洲伊人一本大道中文字幕| 欧美激情一区二区三级高清视频| 男女视频一区二区| 亚洲电影毛片| 另类欧美日韩国产在线| 模特精品裸拍一区| 亚洲国产成人porn| 美女脱光内衣内裤视频久久网站| 久久亚洲一区| 亚洲国产精品ⅴa在线观看| 久久亚洲综合色| 欧美激情第二页| 亚洲精品在线电影| 欧美精品aa| 日韩亚洲欧美在线观看| 亚洲午夜视频在线| 国产精品视频自拍| 欧美专区在线观看| 免费的成人av| 99国产精品国产精品毛片| 欧美日韩国产首页在线观看| 亚洲精品视频一区| 亚洲一区www| 国产欧美日韩91| 欧美在线视频一区| 欧美激情中文字幕乱码免费| 亚洲美女诱惑| 国产精品久久久久一区二区| 亚洲一区久久| 美女视频网站黄色亚洲| 亚洲精品国产精品国自产观看| 欧美伦理视频网站| 午夜精品久久久久久久| 久久免费精品视频| 亚洲美女av在线播放| 欧美日韩视频不卡| 欧美一区二区视频在线| 欧美电影美腿模特1979在线看 | 欧美偷拍另类| 午夜久久一区| 欧美黄色aaaa| 午夜久久福利| 亚洲国产成人不卡| 欧美日韩亚洲免费| 欧美一级视频免费在线观看| 欧美激情2020午夜免费观看| 在线亚洲一区二区| 国产又爽又黄的激情精品视频| 久久在线免费视频| 亚洲视频精品在线| 欧美激情一区二区三区蜜桃视频| 亚洲一区二区三区欧美| 136国产福利精品导航网址| 欧美午夜在线| 美女久久一区| 欧美在线观看一区| 中文高清一区| 亚洲国产精品va在线看黑人动漫| 欧美在线亚洲综合一区| 一区二区三区四区五区精品视频 | 欧美日韩国语| 久久婷婷激情| 欧美一级理论性理论a| 日韩视频专区| 亚洲黄色在线看| 久久最新视频| 久久精品欧洲| 午夜老司机精品| 一个色综合av| 99国产精品99久久久久久| 伊人狠狠色j香婷婷综合| 国产精品一区二区三区久久久| 欧美美女视频| 欧美激情一二三区| 欧美大胆人体视频| 久久久久久色| 久久精品亚洲一区二区| 欧美一区二区观看视频| 亚洲一区二区三区高清 | 久久视频在线看| 欧美在线3区| 午夜电影亚洲| 亚洲综合激情| 亚洲小视频在线观看| 99视频精品全部免费在线| 亚洲日本激情| 亚洲精品视频一区| 亚洲乱码国产乱码精品精可以看| 亚洲国产精品一区二区尤物区| 狠狠色综合一区二区| 精品电影一区| 在线精品国产欧美| 亚洲国产精品成人综合| 亚洲人成人一区二区三区| 亚洲欧洲一区二区三区| 亚洲精品一区二区网址| 一区二区精品| 亚洲在线一区| 久久成人精品视频| 久久一本综合频道| 亚洲第一页自拍| 99pao成人国产永久免费视频| 日韩视频中午一区| 亚洲综合成人婷婷小说| 欧美一区免费| 欧美国产视频一区二区| 欧美日韩午夜激情| 国产视频一区二区在线观看| 黄色成人片子| 99re6这里只有精品视频在线观看| 日韩视频精品在线| 欧美一级片在线播放| 狼狼综合久久久久综合网| 亚洲国产免费| 亚洲免费在线视频一区 二区| 欧美综合国产精品久久丁香| 免费亚洲电影在线| 国产精品久久久久婷婷| 国内精品视频一区| 99人久久精品视频最新地址| 午夜在线一区| 亚洲国产高清一区| 亚洲欧美成人在线| 欧美成人午夜激情视频| 国产精品美女www爽爽爽| 1769国内精品视频在线播放| 一区二区欧美在线| 久久一区二区三区国产精品| 亚洲美女一区| 裸体丰满少妇做受久久99精品| 欧美视频成人| 亚洲激情欧美激情| 久久精品99国产精品| 亚洲精品一区中文| 美女被久久久| 国产亚洲亚洲| 亚洲欧美一区二区在线观看| 亚洲国产精品激情在线观看| 欧美一区二区三区男人的天堂|