/*

hex2dec copyright 2001 by Gene Davis
I hereby release this to the public domain

*/

#include <stdlib.h>

int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("\n\nIncorrect format for hex2dec.");
    printf("\nhex2dec [hexadecimal # to convert to decimal]\n\n");
  }
  else {
    char *remainder;
    long l = strtol(argv[1], &remainder, 16);
    printf("\n%ld\n\n", l);
  }
  return 0;
}
