cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
struct Data Structure
struct Data Structure
Jan 12, 2014 at 11:28pm UTC
thejosheb
(5)
1
2
3
4
5
6
struct
foo{
unsigned
bar0:1;
unsigned
bar1:1;
unsigned
bar2:1;
unsigned
bar3:2; };
When a struct data type is defined and there are ":" placed behind the members, is that there to allocate that one bit of the unsigned space in memory is the foo->bar1 and then 2 bits are used for foo->bar3.
Jan 13, 2014 at 1:49am UTC
LB
(13399)
They are called bit fields:
http://en.cppreference.com/w/cpp/language/bit_field
Last edited on
Jan 13, 2014 at 1:49am UTC
Jan 13, 2014 at 2:38am UTC
thejosheb
(5)
Thank you
Topic archived. No new replies allowed.