?? unpack.c
字號:
/**************************************************************************
*
* ROUTINE
* unpack (unpack from binary to decimal)
*
* FUNCTION
* Input binary array and number of binary bits,
* program returns unpacked decimal value.
*
* SYNOPSIS
* subroutine unpack(array, bits, value, pointer)
*
* formal
*
* data I/O
* name type type function
* -------------------------------------------------------------------
* array short i array to which one bit is assigned
* for binary representation
* bits int i number of bits to convert
* (ie. 01001 for 5 bits, 1st 0 incl.)
* value int o decimal value to convert to
* pointer int i/o points to appropriate element in
* array
*
***************************************************************************
*
* DESCRIPTION
*
* This program unpacks binary values packed by pack.c
* into decimal values.
*
***************************************************************************
*
* CALLED BY
*
* celp dcodcbg dcodcbi dcodpg dcodtau
*
* CALLS
*
*
*
***************************************************************************
*
* REFERENCES
*
*
**************************************************************************/
unpack(array, bits, value, pointer)
int bits, *value, *pointer;
short array[];
{
int i;
for (i = 0, *value = 0; i < bits; i++, (*pointer)++)
*value |= array[*pointer+1] << i;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -