Listing 1 This is a function that takes a variable number of arguments, passes them to the sprintf function for formatting, and then processes the resulting string one character at a time.

#define SIZE_BUFFER 1024
do_it_one_at_a_time(char *format, ...)
  {
  int length;
  int i;
  va_list arg_ptr;
  va_start(arg_ptr, format);
  char buffer[SIZE_BUFFER];
  length = vsprintf(buffer, format, arg_ptr);

  for (i = 0; i < length; i++)
     {
     do_it_for_one(buffer[i]);
     }

  va_end(arg_ptr);
  }
/*  End of File */