There're some issues in this block
for(int i = 0; i < polyFile.eof(); ++i)
{
if(polyArray[i] = ')')
{
polyArray[i + 1] = mathOperator;
cout << mathOperator;
}
}
1/ In the for loop, you want to use i < counter rather than polyFile.eof()
2/ In the if statement, you probably want to use if(!strcmp(polyArray[i], ")")); "=" is an assignment operator, not a comparison one
3/ This line:
polyArray[i + 1] = mathOperator;
mean you're assigning mathOperator to polyArray[i+1], not storing whatever in polyArray[i+1] to mathOperator. This is what you desired:
mathOperator = polyArray[i + 1];