/******************************************************************************
 * Author:        Shawn Stoffer
 * 
 * Description:   This program will basically print out each ascii character
 *                in turn.  It will print only three ascii characters, and
 *                their values, per line.
 * 
 *****************************************************************************/
/* Note, this is a C language program, NOT C++. */
/* This is needed for sprintf and printf */
#include <stdio.h>

int main() {
  unsigned char c;
  char buf[50];

  /* 
   * All this does is run through a loop, once for each ascii character. 
   *  The sprintfs assemble the string to be output, and the printf actually
   * outputs the string.  A newline is output every three characters to make
   * the output 'prettier' and to make it so that we do not have one
   * EXCESSIVELY long line.
   */
  for (c = 0; c < 255; c++) {
    sprintf(buf, "0x%x", (int)c);
    sprintf(buf, "%s |%c|", buf, c);
    printf("%-20s", buf);
    if ((c % 3) == 0) printf("\n");
  }
  printf("\n");
  return 0;
}
 
