After compiling the program, it doesn't show any errors or warnings. When the output screen loads, it asks for the input but doesn't show the output and program automatically closes. Any idea why?
Code:#include<stdio.h> #include<conio.h> void push(char); void pop(); int top=0; char stack[10],info; void main() { int i; char str[10]; clrscr(); printf("Enter a string: "); gets(str); for(i=0;str[i]!='\0';i++) { info=str[i]; push(info); } pop(); getch(); } void push(char info) { stack[top]=info; top++; } void pop() { while(stack[top]!=NULL) { printf("%c",stack[top]); top--; } }



LinkBack URL
About LinkBacks




...Problem solved xD