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


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!!!!


发表评论

电子邮件地址不会被公开。 必填项已用*标注