Re: newbie - int and unsigned int
Re: newbie - int and unsigned int
- Subject: Re: newbie - int and unsigned int
- From: Ondra Cada <email@hidden>
- Date: Mon, 17 May 2004 02:41:09 +0200
On 17.5.2004, at 1:57, 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.
In a vast majority of cases freely mix'em: "int
i=uintVal+intVal-uintVal*intVal...", no problem.
In cases you need to (like in comparations), use a cast:
unsigned u=...; if ((int)u<0) ...
>
sorry 'bout the newbie question but i'm new to C and the apple
>
documentation assumes a knowledge of C.
Do read a good book (the old, but still excellent, K&R --
http://www.amazon.co.uk/exec/obidos/ASIN/0131101633 -- comes to mind).
Although C _is_ easy, it's not that easy so as you can program
efficiently without some learning before.
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.