- 18
- 0
- 约5.49万字
- 约 9页
- 2016-12-23 发布于河南
- 举报
C++ sizeof 及 涉及的内存对齐 收藏
关于sizeof的问题,本人对这个问题也一直没有得到很好的解决,这里对平日收集总结作了些许整理,以便以后翻阅.
一、首先看看sizeof和strlen在MSDN上的定义:
首先看一MSDN上如何对sizeof进行定义的:
sizeof Operator
sizeof expression
The sizeof keyword gives the amount of storage, in bytes, associated with a variable or a type
(including aggregate types). This keyword returns a value of type size_t.
The expression is either an identifier or a type-cast expression (a type specifier enclosed in
parentheses).
When applied to a structure type or variable, sizeof returns the actual size, which may include
padding bytes inserted for alignment. When applied t
原创力文档

文档评论(0)