The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: xroot on July 18, 2010, 03:19:59 PM

Title: sizeof of a struct
Post by: 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?
Thanks
Title: Re: sizeof of a struct
Post by: jj2007 on July 18, 2010, 03:47:23 PM
Try print str$(RECT), " bytes", 13, 10
Otherwise, many windows structures have a cbSize member.
Title: Re: sizeof of a struct
Post by: clive on July 18, 2010, 03:50:37 PM
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.