piclist 2001\12\03\123728a >
Thread: Accessing a var as a byte or bits in C
www.piclist.com/techref/microchip/languages.htm?key=c
flavicon
face BY : mikespamBeGone@KILLspamwhitewing.co.uk



In Hitech C, is it possible to access the same variable as two
different types in C, specifically bits and bytes ?
For example I want some bit variables for various option flags, but
want to access them all as a single byte when saving/loading them to
eeprom.

Can unions be used to do this ?  
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


<kfdn0usmljb3pk5tnpv67btvmk8elrlnh9@4ax.com> quoted-printable

See also: www.piclist.com/techref/microchip/languages.htm?key=c
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Accessing a var as a byte or bits in C

month overview.

new search...