byte2char.c

来自「MP3程序采用C51编程适用于任何环境」· C语言 代码 · 共 22 行

C
22
字号
#ifndef _COMMON_DEFINE
 #include "COMMON.c"
#endif

void BYTE2CHAR(BYTE in,CHAR *out,BYTE l);
void BYTE2CHAR(BYTE in,CHAR *out,BYTE l)
{
	data BYTE temp,i;
	
	i=0;
	temp=in/100;
	if (l>2) out[i++]=temp+48;
	if (temp) in-=(temp*100);
	temp=in/10;
	if (l>1) out[i++]=temp+48;
	if (temp) in-=(temp*10);
	temp=in;
	out[i++]=temp+48;
	out[i]=0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?