cre_asctab.c

来自「个人曾经在工作上的源代码」· C语言 代码 · 共 54 行

C
54
字号
/***
*Cre_AscTab.c - 生成ASCII代码对照表的程序. (需在DOS下查看)
*
*Purpose:
*	用于调试时需要用到的ASCII代码对照表. 
*
*Copyright:
*	Modified by Denny
*	2008-05-22 09:42
*	All rights reserved.
*
*Environment:
*	Editor - SourceInsight 3.5
*	Edit font - Consolas - 12
*	Tab width - 4 (Uses spaces in place of Tabs)
*	Compiler - Turbo C 2.0
*   Run - Microsoft DOS
*
*Exceptions:
*
****/
#include <stdio.h>

void main(void)
{
	unsigned char i = 0;
	unsigned char j = 0;
	FILE *dst;
	
	dst = fopen("Ascii.out", "wb");
	if (dst == NULL)
		exit(0);
	do
	{
		fprintf(dst, "%c ", j++, i);
		if (j % 16 == 0)
			fputs("\x0D\x0A", dst);
	}while(++i);

	fputs("\x0D\x0A", dst);
	fputs("\x0D\x0A", dst);
	fputs("\x0D\x0A", dst);
	fputs("\x0D\x0A", dst);
	i = 0; j = 0;
	do
	{
		fprintf(dst, "%02x:%c  ", j++, i);
		if (j % 8 == 0)
			fputs("\x0D\x0A", dst);
	}while(++i);

	fclose(dst);
}

⌨️ 快捷键说明

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