By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.

bitmap to array?

P: 79
How to store the bitmap value (1 or 0) to integer array?
Mar 18 '07 #1
Share this Question
Share on Google+
2 Replies


arne
Expert 100+
P: 315
How to store the bitmap value (1 or 0) to integer array?
Most simple approach: a two dimensional array like
Expand|Select|Wrap|Line Numbers
  1. int bitmap[rows][columns];
  2.  
Mar 18 '07 #2

Expert 100+
P: 1,510
How to store the bitmap value (1 or 0) to integer array?
it depends how efficent you want to be - you can store a 0 or 1 in any int type and the simplest would be a char which is a byte sized integer. However, only one bit of the byte would be used. You can have a more sophisticated system where you could store 8 bits in byte but this would require using bitfields or shifting and masking using bitwise operators
Mar 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.