user-0 提问: 出现0xC00000FD: Stack overflow错误，应该怎么改正，求大神解决！

回复:
user: user-1
content: 仅供参考：#include <stdio.h> #include <string.h> #include <stdlib.h> #include <locale.h> #include <conio.h> const int  DIGIT=1; const int MAXLEN=16384; char s[MAXLEN],*endss; void show(int ST[10],int ist,char op[10],int iop,int last,char *expr,char *pp,int level) {     int i;      printf("level:%d\n",level);     printf("last:%s\n",last==DIGIT?"DIGIT":"OPREATOR");     printf("expr:%s\n",expr);     printf("pp^ :%*s^\n",pp-expr,"");     printf("ST:");     for (i=0;i<ist;i++) printf(" %d",ST[i]);     printf("\n");     printf("op:");     for (i=0;i<iop;i++) printf(" %c",op[i]);     printf("\n");     printf("\n");     getch(); } int calc(char *expr,char **addr,int level) {     int ST[10]={0}; //数字栈     char op[10]={'+'}; //运算符栈     char c,*pp;     int ist=1,iop=1,last;     char cc;      pp=expr;     last = !DIGIT;     printf("calc函数开始...\n");show(ST,ist,op,iop,last,expr,pp,level);      if ((c=*pp)=='!') {         printf("遇!，改栈底为!\n");         op[0] = c;         pp++;         show(ST,ist,op,iop,last,expr,pp,level);     }     while (1) {         c=*pp;         if (c==0) break;         if (c=='(') {             printf("遇(，递归调用calc...\n");             ST[ist++]=calc(++pp,addr,level+1);             pp = *addr;             last = DIGIT;             show(ST,ist,op,iop,last,expr,pp,level);         } else if (c==')') {             pp++;             show(ST,ist,op,iop,last,expr,pp,level);             break;         } else if (c=='+'||c=='*') {             if (last != DIGIT) {                 printf("运算符粘连\n");exit(5);             }             pp++;             if (c=='+') {                 printf("遇+，计算栈中保存的表达式...\n");                 show(ST,ist,op,iop,last,expr,pp,level);                 do {                     cc = op[--iop];                     --ist;                     switch (cc) {                     case '+':  ST[ist-1] |= ST[ist];break;                     case '*':  ST[ist-1] &= ST[ist];break;                     case '!':  ST[ist-1] =1-ST[ist];break;                     }                     show(ST,ist,op,iop,last,expr,pp,level);                 } while (iop);                 op[iop++] = c;                 printf("计算结果...\n");show(ST,ist,op,iop,last,expr,pp,level);             } else if (c=='*') {                 cc = op[iop-1];                 if (cc=='+') {                     printf("遇*，且栈顶是+，将*压栈...\n");                     op[iop++] = c;                     show(ST,ist,op,iop,last,expr,pp,level);                 } else {                     printf("遇*，且栈顶是*或!，将旧栈顶两数*的结果或旧栈顶!的结果作为新栈顶...\n");                     --ist;                     op[iop-1] = c;                     switch (cc) {                     case '*':  ST[ist-1] &= ST[ist];break;                     case '!':  ST[ist-1] =1-ST[ist];break;                     }                     show(ST,ist,op,iop,last,expr,pp,level);                 }             }             last = !DIGIT;         } else if (c=='!') {             printf("遇!，将!和0压栈\n");             op[iop++] = c;             ST[ist++] =0;             pp++;             show(ST,ist,op,iop,last,expr,pp,level);         } else {             if (last == DIGIT) {                 printf("两数字粘连\n");exit(7);             }             if (!(pp[0]=='0'||pp[0]=='1')) {                 printf("非法字符\n");exit(8);             }             printf("遇%c，压栈...\n",pp[0]);             ST[ist++]=pp[0]-'0';             pp++;             last = DIGIT;             show(ST,ist,op,iop,last,expr,pp,level);         }     }     *addr=pp;     if (iop>=ist) {         printf("表达式有误\n");exit(9);     }     printf("calc函数结束前计算栈中保存的表达式...\n");show(ST,ist,op,iop,last,expr,pp,level);     while (iop) {         --ist;         switch (op[--iop]) {         case '+':  ST[ist-1] |= ST[ist];break;         case '*':  ST[ist-1] &= ST[ist];break;         case '!':  ST[ist-1] =1-ST[ist];break;         }         show(ST,ist,op,iop,last,expr,pp,level);     }     printf("返回计算结果...\n");show(ST,ist,op,iop,last,expr,pp,level);     return ST[0]; } int main() {     setlocale(LC_ALL,"chs");     while (1) {         printf("请输入布尔表达式，比如!(1+1)*1：");fflush(stdout);         rewind(stdin);         gets(s);         if (s[0]==0) break;//         printf("%s的最终结果为%d\n",s,calc(s,&endss,1));     }     return 0; }

user: user-1
content: 崩溃的时候在弹出的对话框按相应按钮进入调试，按Alt+7键查看Call Stack即“调用堆栈”里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处，看不懂时双击下一行，直到能看懂为止。

user: user-2
content: if(' ' != ch) buffer[n++] = ch; 这个判断是什么意思？是不是应该去掉这个判断，直接执行buffer[n++] = ch;n呢