Logo

Programming-Idioms

History of Idiom 109 > diff from v7 to v8

Edit summary for version 8 by :
New Ada implementation by user [Smaehtin]

Version 7

2016-01-21, 09:21:13

Version 8

2016-02-16, 22:08:27

Idiom #109 Number of bytes of a type

Set n to the number of bytes of a variable of type T.
This makes different sense (if any), depending on the language.

Idiom #109 Number of bytes of a type

Set n to the number of bytes of a variable of type T.
This makes different sense (if any), depending on the language.

Code
N : Integer := T'Size / 8;
Comments bubble
T'Size returns size of T in bits, divide by 8 to convert to bytes