You should uses an inline function instead:
#define operand(x)(x>='a'&&x<='z' || x>='A'&&x<='Z' || x>='0'&&x<='9')
You should initialize your variable when you declare them when possible. Also, you should indent and space your code to make it more lisible:
int isp(char x)
{
int y = (
x == '(' ? 6 :
x == '^' ? 4 :
x == '*' ? 2 :
x == '/' ? 2 :
x == '+' ? 1 :
x == '-' ? 1 :
x == ')' ? 0 :
-1);
return y;
}
In fact since the function only return the value, you could replace
int y =
with
return
and remove the line with
return y;
. Using a variable might help if you would use a debugger as suggested as it would allows to inspect the variable.
Next if we continue until the following code:
for(int j=0;j<=jomleTokalame(matn[loc][i]);j++){
cout<<str[j];
we can see that there is a problem with this code. The main problem is that i is equal to the number of lines that were previously read. This whole loop works on empty string.
Incorrect indexes cause this part and most of the remainding code to essentially do nothing as it works on empty strings.
Also there is another issue with the following code:
if(matn[loc][i]=="input")
{
It will only works as expected if the input contains one word per line and without extra spaces. If all words on a line should be processed or if the first word on a line should be processed, it won't works as he would compare the whole line with a word like
input
.