calis
asked on
What is the equivalent to the sizeoff(variable) in C
What is the equivalent to the
sizeoff(varname)in C and could I please have an example.
sizeoff(varname)in C and could I please have an example.
Also, if you have the following:
Dim Z as Long
Z=32768
if you do: len(Z) you will always get 4 because it takes 4 bytes to store a long number...
if you do len(cstr(Z)) you will get 5, because there are 5 characters in "32768"
Cheers!
5
4
4
?zz
0
zz=32767
Dim Z as Long
Z=32768
if you do: len(Z) you will always get 4 because it takes 4 bytes to store a long number...
if you do len(cstr(Z)) you will get 5, because there are 5 characters in "32768"
Cheers!
5
4
4
?zz
0
zz=32767
ASKER
I need to find the sizeof of a UDT to pass to my C API
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
LenB will return size in bytes.
MsgBox LenB(yourUDT)
MsgBox LenB(yourUDT)
There really is no sizeof in VB.
For example:
Dim X as String
Dim Y as Long
X="abcdefg"
Y=Len(X)
'Y will equal 7
Cheers!