比较应用程序级别和自由级别的结构大小. [英] compare the size of structure at application level and at librery level.

查看:69
本文介绍了比较应用程序级别和自由级别的结构大小.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人

我试图在应用程序级别以及我们在内部库中调试并检查其大小时发现可用结构的大小差异.
谁能建议我一种优化和快速的方法来计算差异,因为这些结构非常大.

:)

Dear all

i am trying to find the difference in size of struture availble at application level and when we debug and check its size in internal library.
can anyone suggest me a optimize and fast way to calculate the difference as these sturucture are very big.

:)

推荐答案

巨大的结构??听起来您有更多的设计问题,而不仅仅是做数学.结构绝不能过大以至于不能被描述为巨大".如果您可以用较小的字节数来描述它们,那很好,但是如果您需要一些巨大的东西,那么使用类是更好的方法.

现在,如果您想要结构的大小,则需要知道结构的起始地址和最后一个成员的地址,以及最后一个成员的大小.
Huge structures?? It sounds like you have more of a design problem than doing simply math. Structures should never be so large as to be described as "huge". If you can describe them in terms of smallish number of bytes, great, but if you need something HUGE, classes are a better way to go.

Now, if you want the size of the structure, you''d need to know the starting address of the structure and address of the last member, as well as, the size of the last member.


你好,

我没有完全了解您,但是如果您说您想让bw与众不同,那么这些结构将用于sizeof()函数.

只需记住#pragma包(如果您正在使用它).
Hi,

Im not getting you completely, but if u say u want the difference bw the structures go for the sizeof() function.

just keep in mind about the #pragma pack ,if u are using it.


这篇关于比较应用程序级别和自由级别的结构大小.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆