Sizeof values Data types

Started by Frank Brübach, June 01, 2024, 02:36:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Frank Brübach

Perhaps Somebody needs it, sizeof some Data types

Oxygen Basic

' oxygen basic, sizeof values
'
Print SizeOf(Byte) ' returns 1

Type mybar
    a As Integer '4
    b as float '4
    c as long '4
    d As Double '8
    e as ulong '4
    f as short '2
    g as byte '1
    h as char ' 1
    j as int '4
    k as char ' 1
End Type

Dim myfoo As mybar
Print SizeOf(myfoo) ' returns 40
 
Type mybar2
    l as quad '8
    m as dword ' 4
    n as qword ' 8
    o as word ' 2
    p as ubyte ' 1
    q as string ' 4
    r as bstr ' 4
    s as zstring ' 1
    t as wstring '4
    u as bstring ' 4
End Type

Dim myfoo2 As mybar2
Print SizeOf(myfoo2) ' returns 48