News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

sizeof of a struct

Started by xroot, July 18, 2010, 03:19:59 PM

Previous topic - Next topic

xroot

Is there a way to get the sizeof a structure with only the pointer to the structure?
Thanks

jj2007

Try print str$(RECT), " bytes", 13, 10
Otherwise, many windows structures have a cbSize member.

clive

Quote from: xroot on July 18, 2010, 03:19:59 PM
Is there a way to get the sizeof a structure with only the pointer to the structure?

Generally no, if you just have an address to something you can't infer any size or dimension. Typically if you are passing structures you either know the size, of have a field/record within the structure, or passed as a calling parameter, containing the size information.
It could be a random act of randomness. Those happen a lot as well.