You can use bitfields, but the op wanted to save space - your bit field will occupy sizeof(int) bytes in memory, not only the 12 bits you're using ( that's what I remember, haven't verified now)
Axel Am 08.03.2012 03:58 schrieb "Fahad mansoor" <[email protected]>: > Can't you just use bitfields in c++ ? > > something like > class int3 > { > int data:12; > public: > //members > //comparison function > } > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
