Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Storing / Inserting Data per BIT
Re: Storing / Inserting Data per BIT [message #36061 is a reply to message #36060] Sun, 22 April 2012 17:12 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Depending on your situation, you may find bit-field more handy in your case:

//<9 bit empty><10 bit as a number 0-1023><10 bit as a number 0-1023><....>
//I need 16 Byte in complete... just told you the first 29 BIT.

struct MyData
{
    unsigned dummy:9;
    unsigned number1:10;
    unsigned number2:10;
    //....
};


Then you can modify each field as you do a normal variable, and load/store the whole 16 bytes together.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to get pixels per millimeter for current screen?
Next Topic: How to stop SetTimeCallback
Goto Forum:
  


Current Time: Wed May 15 03:09:14 CEST 2024

Total time taken to generate the page: 0.02888 seconds