Re: Increment integer
Re: Increment integer
- Subject: Re: Increment integer
- From: Cameron Hayne <email@hidden>
- Date: Fri, 24 Oct 2003 15:27:03 -0400
On 24/10/03 1:53 PM, "Eivind Andersen" <email@hidden> wrote:
>
Int number = 0;
>
number ++;
>
or
>
number = number + 1;
>
but the value of the variable increases with 4 (!)
Please show us the exact code you are using to increment the variable and to
print out its value.
The following code prints 1 as it should.
int number = 0;
number++;
NSLog(@"%d", number);
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.