/* LET2ASC */

/* A program to convert an inputted ASCII letter to its ASCII value */
/* Insert non printable characters (Ctrl-I [tab] etc.) in quotes.  Does */
/* not work with the " character due to AmigaDOS being stupid */

/* © Mike Richmond 1995 */

/* Development history : */
/* v1.00	Initial version */


#include <stdio.h>

/* CONSTANTS (Error strings etc.) */

#define VERSION	"v1.00"					
#define DATE "(17/4/95)"
#define INVALID_STRING "Argument must be a single character"
#define USAGE_STRING "A utility to display the ASCII code of a given character\n\nUsage: LET2ASC <character>\n\n" 

void main(int argc, char *argv[])
{
	unsigned char letter;
	
	printf("\nLET2ASC %s by Mike Richmond %s.\n",VERSION,DATE);
	
	if (argc !=2) {
		/* wrong arguments, so display the usage string */
		printf(USAGE_STRING);
		exit(20);
	}
	else letter=*argv[1];

	printf("\nASCII code for the \"%c\" character is %d.\n\n",letter,letter);
}	
	

