Variable size/Get: Difference between revisions
(New page: {{task}} Demonstrate how to get the size of a variable. ==Ada== Category:Ada Ada represents the size of a variable in bits, not bytes like many other languages. Int_Bits : consta...) |
m (Date Representation - Getting the Size moved to Data Representation - Getting the Size: Misspelled ''data'') |
(No difference)
|
Revision as of 03:24, 27 February 2007
Variable size/Get
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
Demonstrate how to get the size of a variable.
Ada
Ada represents the size of a variable in bits, not bytes like many other languages.
Int_Bits : constant Integer := Integer'size; Whole_Bytes : constant Integer := Int_Bits / Storage_Unit; -- Storage_Unit is the number of bits per storage element