Word Boundaries and Slack Byte

原创 2012年03月30日 19:27:25

        Computer stores structures using the concept of "word boundaries". The size of a word boundary is machine dependent. In a computer with two bytes word boundary, the members of a structure are stored left_aligned on the word boundary, as shown below. A character data takes one byte and an integer takes two bytes. One byte between them is left unoccupied. This unoccupied byte is know as the slack byte.

         When we declare structure variables, each one of them may contain slack bytes and the values stored in such slack bytes are undefined. Due to this, even if the members of two variable are equal, their structures do not necessarily compare equal. C, Therefore, does not permit comparition of structures. However, we can design our own function that could compare individual members to decide whether the structure are equal or not.


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

正则表达式学习指南(八)----Word Boundaries

Word Boundaries The metacharacter \b is an anchor like the caret and the dollar sign. It matches at...

char, unsigned char = BYTE; short, unsigned short = WORD; long, unsigned long = DWORD;

数据类型 char , unsigned char = BYTE;  short, unsigned short = WORD;  long, unsigned long = DWORD;  i...

BYTE,WORD,DWORD的大小及一些特殊的"高低位宏"

一、定义在VC6.0的Microsoft Visual Studio/VC98/Include/windef.h 里,定义了BYTE,WORD,DWORDtypedef unsigned long  ...
  • ttgoo
  • ttgoo
  • 2011-07-07 23:32
  • 1869

数据类型 -- char , unsigned char = BYTE, short, unsigned short = WORD, long, unsigned long = DWORD, int , unginged int = UINT

数据类型     在Turbo C语言中, 每个变量在使用之前必须定义其数据类型。Turbo C有以 下几种类型: 整型(int)、浮点型(float)、字符型(char)、指针型(*)、无值型 (...

byte[] and int

Byte and Bit difference

  • 2014-03-27 13:06
  • 26KB
  • 下载

8086汇编基础 byte ptr与word ptr实例

镇场诗:慈心积善融学习,技术誓为大家学。善心速造多好事,前人栽树后乘凉。我今于此写经验,愿见文者得启发。 ——————————————————————————————————————————————...

Bit,Byte,WORD,DWORD区别和联系

Bit,Byte,WORD,DWORD区别和联系 1人收藏此文章, 收藏此文章 发表于4个月前 , 已有86次阅读 共0个评论 1人收藏此文章 基本概念: 位(Bit...

Byte Buffers and Non-Heap Memory

kdgregory.com Blog Food Programming Travel Byte Buffers and Non-Heap Memory Mos...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)