Memory layout of a data structure: Difference between revisions

Content deleted Content added
Point to C++ instead of C plus plus
m Switch to header template
Line 37:
25 -
 
==[[{{header|Ada]]}}==
[[Category:Ada]]
type Bit is mod 2;
Line 64:
end record;
 
==[[{{header|C]]}}/[[{{header|C++]]}}==
[[Category:C]]
[[Category:C++]]
Line 82:
The ":1" gives the number of allocated bits. For unused bits (e.g. pin 11 in the 25-pin version above) the field name can be omitted.
 
==[[{{header|Forth]]}}==
[[Category:Forth]]
Low level hardware control is a typical use of Forth. None of this is standard, however, since hardware I/O mechanisms differ on different systems. Forth does not have a structure mechanism, much less bitfields. These would be represented instead via bitmask constants if doing real serial port control.
 
Line 119 ⟶ 118:
Of course, this is a very simplified view of the full RS-232 protocol. Also, although this represents the order of the pins in a D-9 connector, this would not necessarily be the same as the order of the bits in a control register.
 
==[[{{header|Perl]]}}==
[[Category:Perl]]
 
use Bit::Vector::Minimal qw();
my $vec = Bit::Vector::Minimal->new(size => 24);