hello i have wrote a program that converts a statement to sth like the example below please help me:
(9*(1+(3*8)))+(1+(4*5))
into:
9 1 3 8 * + * 1 4 5 * + +
while((c=getch())!='\0'){ /*i dont know whether it is true or not*/
if(c=='('){
co[k]=1;
k++;
break;
}
if(c==')'){
while(k>=0&&k<=20){
co[k]=0;
k--;
}
break;
}
if(c==" "){
break;
} /*this ode may be useful for converting a usual statemnt to poland model*/
if(c==n){
while(n>=1){
rep[i+n]=rep[i+n-1];
n--;
}
rep[i]=c;
i++;
n=counter;
}
if(c==o){
if(co[k]=0){
rep[i+n]=c;
i=i+n;
n=1;
}
else{
while(n>=1){
rep[i+n]=rep[i+n-1];
n--;
}
rep[i]=c;
n=counter;
n++;
counter=n;
}
}
please tell me where is the problem.