Re: newbie - int and unsigned int
Re: newbie - int and unsigned int
- Subject: Re: newbie - int and unsigned int
- From: David Reed <email@hidden>
- Date: Sun, 16 May 2004 20:53:58 -0400
unsigned myUnsignedInt = ABS(myInt); /* ABS is absolute value */
Justin, do yourself a favor and get a good book on C. If you don't know
the language, you're going to have a hard time with Cocoa - it is
basically an object model layered over C.
Your code snippet looks like you're calling unsignedIntValue on an int
variable. This is an NSNumber method, but one cannot invoke methods on
C types anyway.
David.
On Sunday, May 16, 2004, at 19:57 US/Eastern, justin webster wrote:
I cant figure out how to turn an int into an unsigned int.
i.e. get the value of the int without its plus/minus sign.
i'm trying something like this:
int myNewInt = integerOne + [(integerTwo - integerThree)
unsignedIntValue];
and failing.
sorry 'bout the newbie question but i'm new to C and the apple
documentation assumes a knowledge of C.
_______________________________________________
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.
_______________________________________________
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.