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

memory allocation in unix

P: 1

how can i allocate exactly 30 bits (not bytes) using C language on a unix platform.
May 31 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,916
Unless you happen to working on a platform where a char has 2, 3, 5, 6, 10 or 15 bits then it is not possible. Assuming you are working on a platform with 8 bits in a char (which appears to be the most common) then you will have to allocate 32 bits (4 bytes) and not use 2 of them.

P.S. I'm moving this to the correct forum.
May 31 '07 #2

Post your reply

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