Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Examples  

test_string2int.c

This file shows how to use the function string2int().

#include <stdio.h>
#include "infranet.h"

int time_shift = -3600;

int main (int argc, char *argv[])
{
  int   result;
  int   error;

  if (argc != 2)
  {
    fprintf (stderr, "\n\nUsage: string2int.test number\n\n");
    return 1;
  }

  result = string2int (argv[1], &error);
  if (error)
  {
    fprintf (stdout, "\n\n%s is not a number!\n\n", argv[1]);
    return 1;
  }

  fprintf (stdout, "\n\nsizeof(int) = %d", sizeof(int));
  fprintf (stdout, "\n\nThe number is: %d\n\n", result);

  return 0;
}

Generated on Thu Apr 3 16:23:42 2003 for Common_C_libraries by doxygen1.3-rc1