Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating type classes

Status
Not open for further replies.

biot023

Programmer
Nov 8, 2001
403
GB
I need to create a class that holds a value from 0 to 9 - even using chars is too expensive on memory. I tried building a type that stores values in four bools, but this took too much processing time to create & access. Does anybody have any suggestions?
(Man, I'm really hitting this site, today!)
 
well... the smallest value you could store to represent 0-9 would be 4 bits. a char is the smallest thing you could do this with and it being 8 bits you could store 2 values in a single char. Is this along the ways you are trying to do this?

Matt
 
Man, you is a genius!
That solves my problem perfetly.
Thanks alot!
Douglas JL If it don't make you laugh, it ain't true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top