A sample client: reverse.c

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

int main (void)
{
  istack s = istack_new ();
  int i;

  if (s == NULL) {
    fputs ("Couldn't allocate stack\n", stderr);
    exit (1);
  }
  while (scanf ("%d", &i) == 1)
    if (istack_push (s, i) < 0) {
     fputs ("Out of memory\n", stderr);
     exit (1);
    }
  while (istack_height (s) > 0)
    printf ("%d\n", istack_pop (s));
  istack_delete (s);
  return 0;
}