char - short short int in c? -



char - short short int in c? -

i'm trying squeeze much out of memory possible. have matrix of 4.9999995e13 ints need true or false - need 1 bit of storage each of these ints.

i understand there no single bit types in c (maybe can explain why, me), , know if short short int existed 1 byte, same char. of logical operations in c homecoming ints (as few other functions).

so questions are:

is there way of making short short int exist? if utilize char instead, have performance decrease because of casting int have done? is there way i'm missing?

just in-case it's relevant, compiling gcc c99.

edit i've seen on this wikipedia page there _bool type, standard?

the __bool type standard in recent version of c, that's still not want, because __bool still takes @ to the lowest degree 1 byte (as char, definition).

no, if want many boolean bits need pack them bitfield or bit array. there no standard datatype bitfields in c, you're going have write own macros or functions getting bit @ particular offset. hope you're going run on 64-bit machine plenty of ram, otherwise you're going run out of memory , fast.

c char boolean int short

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -