My first bit of advice would be to clean it up a little first.
PC-lint for C/C++ (NT) Vers. 8.00u, Copyright Gimpel Software 1985-2006
--- Module: test.c (C)
test.c 10 [Info 734] Loss of precision (assignment) (31 bits to 7 bits)
test.c 22 [Warning 534] Ignoring return value of function 'fgets(char *, int, FILE *)'
test.c 23 [Info 713] Loss of precision (initialization) (unsigned int to int)
test.c 27 [Info 713] Loss of precision (initialization) (unsigned int to int)
test.c 51 [Warning 676] Possibly negative subscript (-1) in operator '[' [Reference: file test.c: line 51]
test.c 59 [Warning 534] Ignoring return value of function 'fgets(char *, int, FILE *)'
test.c 6 [Info 728] Symbol 'i' (line 6, file test.c) not explicitly initialized
--- Global Wrap-up
test.c 56 [Info 714] Symbol 'infix(void)' (line 56, file test.c) not referenced
test.c 64 [Info 714] Symbol 'postfix(void)' (line 64, file test.c) not referenced
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
test.c:
Warning W8071 test.c 10: Conversion may lose significant digits in function push
Error E2140 test.c 23: Declaration is not allowed here in function prefix
Error E2140 test.c 26: Declaration is not allowed here in function prefix
Error E2140 test.c 27: Declaration is not allowed here in function prefix
Warning W8065 test.c 32: Call to function 'pop' with no prototype in function prefix
Error E2140 test.c 48: Declaration is not allowed here in function prefix
Warning W8065 test.c 76: Call to function 'prefix' with no prototype in function main
*** 4 errors in Compile ***The compiler errors are due to compiling as C++, but the others are worth a look. Some of the lint can be overlooked, but it's always worth looking into and finding out the reason behind the diagnostic.
And this always needs fixin':
scanf("%d", &c);
fflush(stdin);
User Input: Strings and Numbers [C]
Add in not using void main , and it might look like something I'd consider looking into. [I'm not trying to be offensive if it may sound so, I just hate rewriting the same stuff over and over and over...]