The difference between the int value ++; and the value;

来源:互联网 发布:手机淘宝淘抢购 编辑:程序博客网 时间:2024/05/22 09:48

First come to the code:

{

    intAddTag = 3000;

    intAddTag++;

    Flag1 = intAddTag;

    NSLog(@"flag1 %d,intAddTag %d=========",Flag1,intAddTag);

    intAddTag = 3000;

    Flag1 = intAddTag++;

    NSLog(@"flag1 %d,intAddTag %d=========",Flag1,intAddTag);

}


like up, the test builder is IOS ,Xcode 5.0 


print :

2013-09-11 16:28:59.530 PeriodPal[5010:a0b] flag1 3001,intAddTag 3001=========

2013-09-11 16:28:59.530 PeriodPal[5010:a0b] flag1 3000,intAddTag 3001=========


so the value is different!!!!

原创粉丝点击