jibrownie 0 Newbie Poster

please help, the program converts polish notation to reverse polish notation yet when i try to print out any of the elements of string bits or equat it gives me an error

sing namespace std;
string equat, StringBits[26], hold, str;
char c = 'a', oc;
int i;

int main(int argc, char *argv[])
{
	scanf("%s", &equat);

while (equat.length() > 1){
    StringBits[c] = equat.substr(equat.find_last_of('-','+'),3);
    hold = StringBits[c].substr(0,1);
    StringBits[c].erase(0);
	StringBits[c].append(hold);
	str = c;
    equat.replace(equat.find_last_of('-','+'),3,str);
    c++;
          }

 for (oc = 'z'; oc >= 'a'; oc--){
        str = oc;
         equat.replace(equat.find(str),1,StringBits[oc]);
}
    printf("%s", equat);
    system("PAUSE");
    return EXIT_SUCCESS;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.