Okay, I've gotten this far:
Code:
//** Include Files ******************************************************
#include <stdio.h>
#include <stdlib.h>
//** Defines ************************************************************
#define STACK_SIZE 100
//** External Variables *************************************************
int contents[STACK_SIZE];
int main()
{
int i, j;
char ch;
printf("Enter integer: ");
i = 0;
do
{
scanf(" %c", &contents[i]);
printf("You entered %c \r\n", contents[i]);
}while(contents[i++] != '0');
for(j = i; j >= 0; j--)
{
printf("contents[%d] = %c \r\n", j, contents[j]);
}
printf("\n");
system("PAUSE");
}
Notice that I use a 0 char to terminate the loop, but there is a flaw in doing that: what if I have a 0 in the middle of my data? I tried a null, but that doesn't seem to work.