On Sat, 12 Jan 2008 16:45:54 -0600 (CST), sigmacunfu
<sigmacunfu@[EMAIL PROTECTED]
> wrote in comp.lang.c.moderated:
> HI ALL,
>
> 1. I want to know, if it's possible to have a pointer that is pointing
> to an individual bit, say, of an "int"?
No. In C, the smallest addressable object is the byte, best
represented by an unsigned char.
> 2. Suppose that I have declared a "unsigned int", using bitwise
> operations, I have set the higher 16 bits to 1, is it possible now
> that without using bitwise operations, I could copy a 16-bit "unsigned
> short" into its lower 16 bits?
What if unsigned int contains exactly 16 bits, which is true on many
implementations? Then there are no lower bits left.
Assuming you mean "an unsigned integer type with exactly 32 bits", if
your platform has one, then the answer is maybe, but all such
mechanisms would be non-standard and not ****table. There could be
implementations where it is not possible at all.
But the real question is, why do you care? Why would you want to?
> Thanks for any help you could provide.
> eric
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.para****ft.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
--
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
-- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line. Sorry.


|