Re: (OT) Defining Variables in C with Bases other than 2 or 16
From: martin f krafft (madduck_at_debian.org)
Date: 02/14/05
- Previous message: Jon Dowland: "Re: Redundant mail server"
- In reply to: Martin McCormick: "(OT) Defining Variables in C with Bases other than 2 or 16"
- Next in thread: Micha Feigin: "Re: (OT) Defining Variables in C with Bases other than 2 or 16"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 14 Feb 2005 15:38:32 +0100 To: debian-user@lists.debian.org
also sprach Martin McCormick <martin@dc.cis.okstate.edu> [2005.02.14.1525 +0100]:
> typedef char boolean; /* boolean data type */
>
> Is there a similar method of defining a variable such as base 12
> or 24 or any arbitrary value?
No. You will have to use macros or the like to turn an array of ints
into a bitmask. Don't forget to think about endianness, should the
data ever leave your code.
Do you just want a type with different minimum and maximum values?
If yes, then consider simply scaling the ranges to 32bit, using
assertions, or simple error checking instead.
-- Please do not send copies of list mail to me; I read the list! .''`. martin f. krafft <madduck@debian.org> : :' : proud Debian developer, admin, user, and author `. `'` `- Debian - when you have better things to do than fixing a system Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!
-- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- application/pgp-signature attachment: Digital signature
- Previous message: Jon Dowland: "Re: Redundant mail server"
- In reply to: Martin McCormick: "(OT) Defining Variables in C with Bases other than 2 or 16"
- Next in thread: Micha Feigin: "Re: (OT) Defining Variables in C with Bases other than 2 or 16"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|