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

  • Next message: Petri Varsa: "Mozilla and Galeon crashing on startup"
    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
    


  • Next message: Petri Varsa: "Mozilla and Galeon crashing on startup"

    Relevant Pages

    • Re: Announcing a new book: The Debian System -- Concepts and Techniques
      ... Don't worry, we did. ... as well as other parts of the globe. ... Please do not send copies of list mail to me; ... ::': proud Debian developer, admin, user, and author ...
      (Debian-User)
    • Re: xen, raid and initramfs failure
      ... one uses the level= option in mdadm.conf that the 'raid' is not ... in mdadm.conf as a way to determine the required modules for the ... Please do not send copies of list mail to me; ... ::': proud Debian developer, author, administrator, and user ...
      (Debian-User)
    • Re: Nvidia Kernel Drivers ( Sarge )
      ... They are well-made and you can compile drivers with one command: ... Please do not send copies of list mail to me; ... ::': proud Debian developer, admin, user, and author ...
      (Debian-User)
    • Re: unicode troubÃle
      ... > mutt on the other hand replaces every special character with a dotted ... Please do not send copies of list mail to me; ... ::': proud Debian developer, admin, user, and author ... a spade should be compelled to use one. ...
      (Debian-User)
    • Re: sarge freezes after failure of raid disk, incurring fs corruption on unrelated disk
      ... at that, so the broken disk somehow blocks the IDE channel for hdb, ... which is the same for hda, and then the system dies because it ... Please do not send copies of list mail to me; ... ::': proud Debian developer, author, administrator, and user ...
      (Debian-User)