Jump to content
Hostul a fost schimbat. Daca vedeti serverul offline readaugati rpg.b-zone.ro sau 141.95.124.78:7777 in clientul de sa-mp ×

[PASCAL] Sub types


CouldnoT
 Share

Recommended Posts

Sub types

 

There are many sub types for variables, for example, Integer number subtypes differ in the range and the number of required bytes to store values in memory. The table below contains integer types, value ranges, and required bytes in memory:

 

image.thumb.png.b6d916f8d70422643423811b81986cd7.png

 

 

We can get the minimum and maximum values and bytes sizes for each type by using the Low, High, and SizeOf functions respectively, as in the example below:

 

program SubTypes;
uses wincrt;

begin
 Writeln('Byte: Size = ', SizeOf(Byte), ', Minimum value = ', Low(Byte), ', Maximum value = ', High(Byte));
 Writeln('Integer: Size = ', SizeOf(Integer), ', Minimum value = ', Low(Integer), ', Maximum value = ', High(Integer));
 Readln; // avoid closing the program, you can also use readkey
end.

 

 

Edited by CouldnoT
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.