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...

Byte and Bit difference

  • 2014年03月27日 13:06
  • 27KB
  • 下载

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[] and int

  • 2014年04月11日 14:15
  • 3KB
  • 下载

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

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

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

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

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

一、定义 在VC6.0的Microsoft Visual Studio/VC98/Include/windef.h 里,定义了BYTE,WORD,DWORD typedef unsigned lo...
  • whatday
  • whatday
  • 2016年06月07日 11:13
  • 1347

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

慈心积善融学习,技术愿为有情学。善心速造多好事,前人栽树后乘凉。我今于此写经验,愿见文者得启发。 assume cs:code code segment start: ...

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

Bit,Byte,WORD,DWORD区别和联系 1人收藏此文章, 收藏此文章 发表于4个月前 , 已有86次阅读 共0个评论 1人收藏此文章 基本概念: 位(Bit...
  • Hugohut
  • Hugohut
  • 2011年12月05日 22:53
  • 9658
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Word Boundaries and Slack Byte
举报原因:
原因补充:

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