Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
40
Task/Variable-size-Set/PureBasic/variable-size-set.basic
Normal file
40
Task/Variable-size-Set/PureBasic/variable-size-set.basic
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
EnableExplicit
|
||||
|
||||
Structure AllTypes
|
||||
b.b
|
||||
a.a
|
||||
w.w
|
||||
u.u
|
||||
c.c ; character type : 1 byte on x86, 2 bytes on x64
|
||||
l.l
|
||||
i.i ; integer type : 4 bytes on x86, 8 bytes on x64
|
||||
q.q
|
||||
f.f
|
||||
d.d
|
||||
s.s ; pointer to string on heap : pointer size same as integer
|
||||
z.s{2} ; fixed length string of 2 characters, stored inline
|
||||
EndStructure
|
||||
|
||||
If OpenConsole()
|
||||
Define at.AllTypes
|
||||
PrintN("Size of types in bytes (x64)")
|
||||
PrintN("")
|
||||
PrintN("byte = " + SizeOf(at\b))
|
||||
PrintN("ascii = " + SizeOf(at\a))
|
||||
PrintN("word = " + SizeOf(at\w))
|
||||
PrintN("unicode = " + SizeOf(at\u))
|
||||
PrintN("character = " + SizeOf(at\c))
|
||||
PrintN("long = " + SizeOf(at\l))
|
||||
PrintN("integer = " + SizeOf(at\i))
|
||||
PrintN("quod = " + SizeOf(at\q))
|
||||
PrintN("float = " + SizeOf(at\f))
|
||||
PrintN("double = " + SizeOf(at\d))
|
||||
PrintN("string = " + SizeOf(at\s))
|
||||
PrintN("string{2} = " + SizeOf(at\z))
|
||||
PrintN("---------------")
|
||||
PrintN("AllTypes = " + SizeOf(at))
|
||||
PrintN("")
|
||||
PrintN("Press any key to close the console")
|
||||
Repeat: Delay(10) : Until Inkey() <> ""
|
||||
CloseConsole()
|
||||
EndIf
|
||||
Loading…
Add table
Add a link
Reference in a new issue